equal
deleted
inserted
replaced
334 p2i(stack_base()), stack_size()/1024); |
334 p2i(stack_base()), stack_size()/1024); |
335 } |
335 } |
336 |
336 |
337 |
337 |
338 Thread::~Thread() { |
338 Thread::~Thread() { |
339 // Reclaim the objectmonitors from the omFreeList of the moribund thread. |
|
340 ObjectSynchronizer::omFlush(this); |
|
341 |
|
342 EVENT_THREAD_DESTRUCT(this); |
339 EVENT_THREAD_DESTRUCT(this); |
343 |
340 |
344 // stack_base can be NULL if the thread is never started or exited before |
341 // stack_base can be NULL if the thread is never started or exited before |
345 // record_stack_base_and_size called. Although, we would like to ensure |
342 // record_stack_base_and_size called. Although, we would like to ensure |
346 // that all started threads do call record_stack_base_and_size(), there is |
343 // that all started threads do call record_stack_base_and_size(), there is |
4249 // Possible GC point. |
4246 // Possible GC point. |
4250 Events::log(p, "Thread added: " INTPTR_FORMAT, p2i(p)); |
4247 Events::log(p, "Thread added: " INTPTR_FORMAT, p2i(p)); |
4251 } |
4248 } |
4252 |
4249 |
4253 void Threads::remove(JavaThread* p) { |
4250 void Threads::remove(JavaThread* p) { |
|
4251 |
|
4252 // Reclaim the objectmonitors from the omInUseList and omFreeList of the moribund thread. |
|
4253 ObjectSynchronizer::omFlush(p); |
|
4254 |
4254 // Extra scope needed for Thread_lock, so we can check |
4255 // Extra scope needed for Thread_lock, so we can check |
4255 // that we do not remove thread without safepoint code notice |
4256 // that we do not remove thread without safepoint code notice |
4256 { MutexLocker ml(Threads_lock); |
4257 { MutexLocker ml(Threads_lock); |
4257 |
4258 |
4258 assert(includes(p), "p must be present"); |
4259 assert(includes(p), "p must be present"); |