--- a/jdk/src/macosx/native/sun/awt/LWCToolkit.m Mon Apr 14 12:59:50 2014 -0700
+++ b/jdk/src/macosx/native/sun/awt/LWCToolkit.m Tue Apr 15 22:57:02 2014 -0700
@@ -233,15 +233,16 @@
Java_sun_lwawt_macosx_LWCToolkit_initIDs
(JNIEnv *env, jclass klass) {
// set thread names
- dispatch_async(dispatch_get_main_queue(), ^(void){
- [[NSThread currentThread] setName:@"AppKit Thread"];
-
- JNIEnv *env = [ThreadUtilities getJNIEnv];
- static JNF_CLASS_CACHE(jc_LWCToolkit, "sun/lwawt/macosx/LWCToolkit");
- static JNF_STATIC_MEMBER_CACHE(jsm_installToolkitThreadNameInJava, jc_LWCToolkit, "installToolkitThreadNameInJava", "()V");
- JNFCallStaticVoidMethod(env, jsm_installToolkitThreadNameInJava);
- });
-
+ if (![ThreadUtilities isAWTEmbedded]) {
+ dispatch_async(dispatch_get_main_queue(), ^(void){
+ [[NSThread currentThread] setName:@"AppKit Thread"];
+ JNIEnv *env = [ThreadUtilities getJNIEnv];
+ static JNF_CLASS_CACHE(jc_LWCToolkit, "sun/lwawt/macosx/LWCToolkit");
+ static JNF_STATIC_MEMBER_CACHE(jsm_installToolkitThreadInJava, jc_LWCToolkit, "installToolkitThreadInJava", "()V");
+ JNFCallStaticVoidMethod(env, jsm_installToolkitThreadInJava);
+ });
+ }
+
gNumberOfButtons = sun_lwawt_macosx_LWCToolkit_BUTTONS;
jclass inputEventClazz = (*env)->FindClass(env, "java/awt/event/InputEvent");