< prev index next >

src/os/solaris/vm/os_solaris.cpp

Print this page




1204       vm_exit(1);
1205     }
1206     assert(jt->stack_size() >= stack_size,
1207            "Attempt to map more stack than was allocated");
1208     jt->set_stack_size(stack_size);
1209   }
1210 
1211   // With the T2 libthread (T1 is no longer supported) threads are always bound
1212   // and we use stackbanging in all cases.
1213 
1214   os::Solaris::init_thread_fpu_state();
1215   std::set_terminate(_handle_uncaught_cxx_exception);
1216 }
1217 
1218 
1219 
1220 // Free Solaris resources related to the OSThread
1221 void os::free_thread(OSThread* osthread) {
1222   assert(osthread != NULL, "os::free_thread but osthread not set");
1223 


1224 
1225   // We are told to free resources of the argument thread,
1226   // but we can only really operate on the current thread.
1227   // The main thread must take the VMThread down synchronously
1228   // before the main thread exits and frees up CodeHeap
1229   guarantee((Thread::current()->osthread() == osthread
1230              || (osthread == VMThread::vm_thread()->osthread())), "os::free_thread but not current thread");
1231   if (Thread::current()->osthread() == osthread) {
1232     // Restore caller's signal mask
1233     sigset_t sigmask = osthread->caller_sigmask();
1234     pthread_sigmask(SIG_SETMASK, &sigmask, NULL);
1235   }
1236   delete osthread;
1237 }
1238 
1239 void os::pd_start_thread(Thread* thread) {
1240   int status = thr_continue(thread->osthread()->thread_id());
1241   assert_status(status == 0, status, "thr_continue failed");
1242 }
1243 
1244 
1245 intx os::current_thread_id() {
1246   return (intx)thr_self();
1247 }
1248 
1249 static pid_t _initial_pid = 0;
1250 




1204       vm_exit(1);
1205     }
1206     assert(jt->stack_size() >= stack_size,
1207            "Attempt to map more stack than was allocated");
1208     jt->set_stack_size(stack_size);
1209   }
1210 
1211   // With the T2 libthread (T1 is no longer supported) threads are always bound
1212   // and we use stackbanging in all cases.
1213 
1214   os::Solaris::init_thread_fpu_state();
1215   std::set_terminate(_handle_uncaught_cxx_exception);
1216 }
1217 
1218 
1219 
1220 // Free Solaris resources related to the OSThread
1221 void os::free_thread(OSThread* osthread) {
1222   assert(osthread != NULL, "os::free_thread but osthread not set");
1223 
1224   // Usually osthread will be the current thread, but during VM termination
1225   // it might be the VMThread or (what was) the WatcherThread
1226 






1227   if (Thread::current()->osthread() == osthread) {
1228     // Restore caller's signal mask
1229     sigset_t sigmask = osthread->caller_sigmask();
1230     pthread_sigmask(SIG_SETMASK, &sigmask, NULL);
1231   }
1232   delete osthread;
1233 }
1234 
1235 void os::pd_start_thread(Thread* thread) {
1236   int status = thr_continue(thread->osthread()->thread_id());
1237   assert_status(status == 0, status, "thr_continue failed");
1238 }
1239 
1240 
1241 intx os::current_thread_id() {
1242   return (intx)thr_self();
1243 }
1244 
1245 static pid_t _initial_pid = 0;
1246 


< prev index next >