773
774 pthread_attr_destroy(&attr);
775 #else /* __solaris__ */
776 thread_t tid;
777 long flags = 0;
778 if (thr_create(NULL, stack_size, ThreadJavaMain, args, flags, &tid) == 0) {
779 void* tmp;
780 thr_join(tid, NULL, &tmp);
781 rslt = (int)(intptr_t)tmp;
782 } else {
783 /* See above. Continue in current thread if thr_create() failed */
784 rslt = JavaMain(args);
785 }
786 #endif /* !__solaris__ */
787 return rslt;
788 }
789
790 /* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */
791 #define MAX_PID_STR_SZ 20
792
793 void SetJavaLauncherPlatformProps() {
794 /* Linux only */
795 #ifdef __linux__
796 const char *substr = "-Dsun.java.launcher.pid=";
797 char *pid_prop_str = (char *)JLI_MemAlloc(JLI_StrLen(substr) + MAX_PID_STR_SZ + 1);
798 sprintf(pid_prop_str, "%s%d", substr, getpid());
799 AddOption(pid_prop_str, NULL);
800 #endif /* __linux__ */
801 }
802
803 int
804 JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
805 int argc, char **argv,
806 int mode, char *what, int ret)
807 {
808 ShowSplashScreen();
809 return ContinueInNewThread(ifn, threadStackSize, argc, argv, mode, what, ret);
810 }
811
812 void
813 PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm)
814 {
815 // stubbed out for windows and *nixes.
816 }
817
818 void
819 RegisterThread()
820 {
821 // stubbed out for windows and *nixes.
822 }
|
773
774 pthread_attr_destroy(&attr);
775 #else /* __solaris__ */
776 thread_t tid;
777 long flags = 0;
778 if (thr_create(NULL, stack_size, ThreadJavaMain, args, flags, &tid) == 0) {
779 void* tmp;
780 thr_join(tid, NULL, &tmp);
781 rslt = (int)(intptr_t)tmp;
782 } else {
783 /* See above. Continue in current thread if thr_create() failed */
784 rslt = JavaMain(args);
785 }
786 #endif /* !__solaris__ */
787 return rslt;
788 }
789
790 /* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */
791 #define MAX_PID_STR_SZ 20
792
793 int
794 JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
795 int argc, char **argv,
796 int mode, char *what, int ret)
797 {
798 ShowSplashScreen();
799 return ContinueInNewThread(ifn, threadStackSize, argc, argv, mode, what, ret);
800 }
801
802 void
803 PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm)
804 {
805 // stubbed out for windows and *nixes.
806 }
807
808 void
809 RegisterThread()
810 {
811 // stubbed out for windows and *nixes.
812 }
|