changeset 25769:f18107faec8f

8049198: [macosx] Incorrect thread access when showing splash screen Reviewed-by: serb, pchelko
author alexsch
date Fri, 11 Jul 2014 12:08:43 +0400
parents b10ec9701a7e
children d132697706ea
files jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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];