< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m

Print this page
rev 12879 : 8136556: Add the ability to perform static builds of MacOSX x64 binaries
Reviewed-by: ihse, bdelsart, gadams, lfoltan, rriggs, hseigel, twisti


 723 
 724     [ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, appkitThreadGroup)];
 725 
 726     // Launcher sets this env variable if -XstartOnFirstThread is specified
 727     char envVar[80];
 728     snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
 729     if (getenv(envVar) != NULL) {
 730         forceEmbeddedMode = YES;
 731         unsetenv(envVar);
 732     }
 733 
 734     if (isSWTInWebStart(env)) {
 735         forceEmbeddedMode = YES;
 736     }
 737 
 738     [AWTStarter start:headless ? YES : NO];
 739 
 740     JNF_COCOA_EXIT(env)
 741 }
 742 
 743 JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
 744     OSXAPP_SetJavaVM(vm);
 745 
 746     // We need to let Foundation know that this is a multithreaded application, if it isn't already.
 747     if (![NSThread isMultiThreaded]) {
 748         [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil];
 749     }
 750 
 751     return JNI_VERSION_1_4;
 752 }
 753 
 754 /*
 755  * Class:     sun_lwawt_macosx_LWCToolkit
 756  * Method:    isEmbedded
 757  * Signature: ()Z
 758  */
 759 JNIEXPORT jboolean JNICALL
 760 Java_sun_lwawt_macosx_LWCToolkit_isEmbedded
 761 (JNIEnv *env, jclass klass) {
 762     return isEmbedded ? JNI_TRUE : JNI_FALSE;
 763 }


 723 
 724     [ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, appkitThreadGroup)];
 725 
 726     // Launcher sets this env variable if -XstartOnFirstThread is specified
 727     char envVar[80];
 728     snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
 729     if (getenv(envVar) != NULL) {
 730         forceEmbeddedMode = YES;
 731         unsetenv(envVar);
 732     }
 733 
 734     if (isSWTInWebStart(env)) {
 735         forceEmbeddedMode = YES;
 736     }
 737 
 738     [AWTStarter start:headless ? YES : NO];
 739 
 740     JNF_COCOA_EXIT(env)
 741 }
 742 
 743 JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *vm, void *reserved) {
 744     OSXAPP_SetJavaVM(vm);
 745 
 746     // We need to let Foundation know that this is a multithreaded application, if it isn't already.
 747     if (![NSThread isMultiThreaded]) {
 748         [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil];
 749     }
 750 
 751     return JNI_VERSION_1_4;
 752 }
 753 
 754 /*
 755  * Class:     sun_lwawt_macosx_LWCToolkit
 756  * Method:    isEmbedded
 757  * Signature: ()Z
 758  */
 759 JNIEXPORT jboolean JNICALL
 760 Java_sun_lwawt_macosx_LWCToolkit_isEmbedded
 761 (JNIEnv *env, jclass klass) {
 762     return isEmbedded ? JNI_TRUE : JNI_FALSE;
 763 }
< prev index next >