226 |
226 |
227 // This initial value ==> never claimed. |
227 // This initial value ==> never claimed. |
228 _oops_do_parity = 0; |
228 _oops_do_parity = 0; |
229 |
229 |
230 // the handle mark links itself to last_handle_mark |
230 // the handle mark links itself to last_handle_mark |
231 new HandleMark(this); |
231 HandleMark *hm = NEW_C_HEAP_OBJ(HandleMark, mtThread); |
232 |
232 hm->initialize(this); |
233 // plain initialization |
233 // plain initialization |
234 debug_only(_owned_locks = NULL;) |
234 debug_only(_owned_locks = NULL;) |
235 debug_only(_allow_allocation_count = 0;) |
235 debug_only(_allow_allocation_count = 0;) |
236 NOT_PRODUCT(_allow_safepoint_count = 0;) |
236 NOT_PRODUCT(_allow_safepoint_count = 0;) |
237 NOT_PRODUCT(_skip_gcalot = false;) |
237 NOT_PRODUCT(_skip_gcalot = false;) |
350 // deallocate data structures |
350 // deallocate data structures |
351 delete resource_area(); |
351 delete resource_area(); |
352 // since the handle marks are using the handle area, we have to deallocated the root |
352 // since the handle marks are using the handle area, we have to deallocated the root |
353 // handle mark before deallocating the thread's handle area, |
353 // handle mark before deallocating the thread's handle area, |
354 assert(last_handle_mark() != NULL, "check we have an element"); |
354 assert(last_handle_mark() != NULL, "check we have an element"); |
355 delete last_handle_mark(); |
355 FREE_C_HEAP_OBJECT(HandleMark, last_handle_mark(), mtThread); |
356 assert(last_handle_mark() == NULL, "check we have reached the end"); |
356 set_last_handle_mark(NULL); |
357 |
357 |
358 // It's possible we can encounter a null _ParkEvent, etc., in stillborn threads. |
358 // It's possible we can encounter a null _ParkEvent, etc., in stillborn threads. |
359 // We NULL out the fields for good hygiene. |
359 // We NULL out the fields for good hygiene. |
360 ParkEvent::Release (_ParkEvent) ; _ParkEvent = NULL ; |
360 ParkEvent::Release (_ParkEvent) ; _ParkEvent = NULL ; |
361 ParkEvent::Release (_SleepEvent) ; _SleepEvent = NULL ; |
361 ParkEvent::Release (_SleepEvent) ; _SleepEvent = NULL ; |