hotspot/src/share/vm/runtime/thread.cpp
changeset 13748 c4455a44f974
parent 13744 631fe815def5
child 13857 93015306affa
child 13859 7fe4578493fc
equal deleted inserted replaced
13747:7dd9c86d03e1 13748:c4455a44f974
   326 
   326 
   327 Thread::~Thread() {
   327 Thread::~Thread() {
   328   // Reclaim the objectmonitors from the omFreeList of the moribund thread.
   328   // Reclaim the objectmonitors from the omFreeList of the moribund thread.
   329   ObjectSynchronizer::omFlush (this) ;
   329   ObjectSynchronizer::omFlush (this) ;
   330 
   330 
   331   address low_stack_addr = stack_base() - stack_size();
   331   // stack_base can be NULL if the thread is never started or exited before
   332   MemTracker::release_thread_stack(low_stack_addr, stack_size(), this);
   332   // record_stack_base_and_size called. Although, we would like to ensure
       
   333   // that all started threads do call record_stack_base_and_size(), there is
       
   334   // not proper way to enforce that.
       
   335   if (_stack_base != NULL) {
       
   336     address low_stack_addr = stack_base() - stack_size();
       
   337     MemTracker::release_thread_stack(low_stack_addr, stack_size(), this);
       
   338   }
   333 
   339 
   334   // deallocate data structures
   340   // deallocate data structures
   335   delete resource_area();
   341   delete resource_area();
   336   // since the handle marks are using the handle area, we have to deallocated the root
   342   // since the handle marks are using the handle area, we have to deallocated the root
   337   // handle mark before deallocating the thread's handle area,
   343   // handle mark before deallocating the thread's handle area,