Index: tools/bootImageRunner/ppc/libvm.c =================================================================== --- tools/bootImageRunner/ppc/libvm.c (revision 15406) +++ tools/bootImageRunner/ppc/libvm.c (working copy) @@ -1116,7 +1116,7 @@ int -createVM(int vmInSeparateThread) +createVM(void) { // don't buffer trace or error message output // @@ -1384,46 +1384,22 @@ fprintf(SysTraceFile, "Done testing faulting-address location\n"); #endif - // execute vm startup thread - // - if (vmInSeparateThread) { - /* Try starting the VM in a separate pthread. We need to synchronize - before exiting. */ - startupRegs[0] = jtoc; - startupRegs[1] = tr; - startupRegs[2] = tid; - startupRegs[3] = fp; - - // clear flag for synchronization - bootRecord.bootCompleted = 0; - - pthread_create(&vm_pthreadid, NULL, bootThreadCaller, NULL); - - // wait for the JNIStartUp code to set the completion flag before returning - while (!bootRecord.bootCompleted) { -#if (_AIX43 || RVM_FOR_LINUX || RVM_FOR_OSX) - sched_yield(); -#else - pthread_yield(); -#endif - } - - return 0; + if (setjmp(primordial_jb)) { + *(int*)(tr + RVMThread_execStatus_offset) = RVMThread_TERMINATED; + // cannot return or else the process will exit. this is how pthreads + // work on the platforms I've tried (OS X and Linux). So, when the + // primordial thread is done, we just have it idle. When the process + // is supposed to exit, it'll call exit(). + for (;;) pause(); } else { - if (setjmp(primordial_jb)) { - *(int*)(tr + RVMThread_execStatus_offset) = RVMThread_TERMINATED; - // cannot return or else the process will exit - for (;;) pause(); - } else { - if (lib_verbose) { - fprintf(SysTraceFile, "%s: calling boot thread: jtoc = " FMTrvmPTR - " tr = " FMTrvmPTR " tid = %d fp = " FMTrvmPTR "\n", - Me, rvmPTR_ARG(jtoc), rvmPTR_ARG(tr), tid, rvmPTR_ARG(fp)); - } - bootThread(jtoc, tr, tid, fp); - fprintf(SysErrorFile, "Unexpected return from bootThread\n"); - return 1; + if (lib_verbose) { + fprintf(SysTraceFile, "%s: calling boot thread: jtoc = " FMTrvmPTR + " tr = " FMTrvmPTR " tid = %d fp = " FMTrvmPTR "\n", + Me, rvmPTR_ARG(jtoc), rvmPTR_ARG(tr), tid, rvmPTR_ARG(fp)); } + bootThread(jtoc, tr, tid, fp); + fprintf(SysErrorFile, "Unexpected return from bootThread\n"); + return 1; } } Index: tools/bootImageRunner/bootImageRunner.h =================================================================== --- tools/bootImageRunner/bootImageRunner.h (revision 15406) +++ tools/bootImageRunner/bootImageRunner.h (working copy) @@ -82,7 +82,7 @@ extern int verboseBoot; /* Defined in libvm.C; used in RunBootImage.C */ -extern int createVM(int); +extern int createVM(void); /* Used in libvm.C; Defined in sys.C */ extern int getArrayLength(void* ptr); Index: tools/bootImageRunner/ia32/libvm.c =================================================================== --- tools/bootImageRunner/ia32/libvm.c (revision 15406) +++ tools/bootImageRunner/ia32/libvm.c (working copy) @@ -960,7 +960,7 @@ /* Returns 1 upon any errors. Never returns except to report an error. */ int -createVM(int UNUSED vmInSeparateThread) +createVM(void) { /* don't buffer trace or error message output */ setbuf (SysErrorFile, 0); @@ -1181,7 +1181,10 @@ // setup place that we'll return to when we're done if (setjmp(primordial_jb)) { *(int*)(tr + RVMThread_execStatus_offset) = RVMThread_TERMINATED; - // cannot return or else the process will exit + // cannot return or else the process will exit. this is how pthreads + // work on the platforms I've tried (OS X and Linux). So, when the + // primordial thread is done, we just have it idle. When the process + // is supposed to exit, it'll call exit(). for (;;) pause(); } else { sp-=4; Index: tools/bootImageRunner/RunBootImage.C =================================================================== --- tools/bootImageRunner/RunBootImage.C (revision 15406) +++ tools/bootImageRunner/RunBootImage.C (working copy) @@ -489,7 +489,7 @@ (void) mach_timebase_info(&timebaseInfo); #endif - int ret = createVM(0); + int ret = createVM(); if (ret == 1) { fprintf(SysErrorFile, "%s: Could not create the virtual machine; goodbye\n", Me); exit(EXIT_STATUS_MISC_TROUBLE);