Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/thread.cpp @ 6745:6dfc6a541338
7198529: NPG: assert with NMT code in Thread destructor
Summary: Thread stack's base address can be NULL if it is not started or exited before recording the base
Reviewed-by: kvn, fparain
author | zgu |
---|---|
date | Fri, 14 Sep 2012 12:55:50 -0400 |
parents | 33143ee07800 |
children | a7509aff1b06 716e6ef4482a |
comparison
equal
deleted
inserted
replaced
6744:7edbe32b9802 | 6745:6dfc6a541338 |
---|---|
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, |