< prev index next >

src/os/solaris/vm/os_solaris.cpp

Print this page

        

@@ -726,10 +726,13 @@
   int pid = os::current_process_id();
   alloca(((pid ^ counter++) & 7) * 128);
 
   int prio;
   Thread* thread = (Thread*)thread_addr;
+
+  thread->initialize_thread_current();
+
   OSThread* osthr = thread->osthread();
 
   osthr->set_lwp_id(_lwp_self());  // Store lwp in case we are bound
   thread->_schedctl = (void *) schedctl_init();
 

@@ -5603,11 +5606,11 @@
   argv[2] = cmd;
   argv[3] = NULL;
 
   // fork is async-safe, fork1 is not so can't use in signal handler
   pid_t pid;
-  Thread* t = ThreadLocalStorage::get_thread_slow();
+  Thread* t = Thread::current_or_null_safe();
   if (t != NULL && t->is_inside_signal_handler()) {
     pid = fork();
   } else {
     pid = fork1();
   }
< prev index next >