8049198: [macosx] Incorrect thread access when showing splash screen
Reviewed-by: serb, pchelko
--- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m Mon Jun 23 10:54:10 2014 -0700
+++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m Fri Jul 11 12:08:43 2014 +0400
@@ -45,6 +45,7 @@
#include <dlfcn.h>
#include <sizecalc.h>
+#import "ThreadUtilities.h"
static NSScreen* SplashNSScreen()
{
@@ -130,8 +131,12 @@
NSAutoreleasePool *pool = [NSAutoreleasePool new];
*scaleFactor = 1;
char* scaledFile = nil;
- float screenScaleFactor = [SplashNSScreen() backingScaleFactor];
-
+ __block float screenScaleFactor = 1;
+
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+ screenScaleFactor = [SplashNSScreen() backingScaleFactor];
+ }];
+
if (screenScaleFactor > 1) {
NSString *fileName = [NSString stringWithUTF8String: file];
NSUInteger length = [fileName length];