< prev index next >

src/share/vm/jfr/recorder/storage/jfrStorage.cpp

Print this page
rev 9053 : 8220293: Deadlock in JFR string pool
Reviewed-by: rehn, egahlin

*** 338,350 **** } void JfrStorage::register_full(BufferPtr buffer, Thread* thread) { assert(buffer != NULL, "invariant"); assert(buffer->retired(), "invariant"); if (!full_buffer_registration(buffer, _age_mspace, control(), thread)) { handle_registration_failure(buffer); - buffer->release(); } if (control().should_post_buffer_full_message()) { _post_box.post(MSG_FULLBUFFER); } } --- 338,350 ---- } void JfrStorage::register_full(BufferPtr buffer, Thread* thread) { assert(buffer != NULL, "invariant"); assert(buffer->retired(), "invariant"); + assert(buffer->acquired_by(thread), "invariant"); if (!full_buffer_registration(buffer, _age_mspace, control(), thread)) { handle_registration_failure(buffer); } if (control().should_post_buffer_full_message()) { _post_box.post(MSG_FULLBUFFER); } }
*** 375,386 **** if (!flush_regular_buffer(buffer, thread)) { buffer->concurrent_reinitialization(); } } assert(buffer->empty(), "invariant"); control().increment_dead(); - buffer->release(); buffer->set_retired(); } void JfrStorage::release_thread_local(BufferPtr buffer, Thread* thread) { assert(buffer != NULL, "invariant"); --- 375,386 ---- if (!flush_regular_buffer(buffer, thread)) { buffer->concurrent_reinitialization(); } } assert(buffer->empty(), "invariant"); + assert(buffer->identity() != NULL, "invariant"); control().increment_dead(); buffer->set_retired(); } void JfrStorage::release_thread_local(BufferPtr buffer, Thread* thread) { assert(buffer != NULL, "invariant");
*** 731,747 **** public: typedef typename Mspace::Type Type; Scavenger(JfrStorageControl& control, Mspace* mspace) : _control(control), _mspace(mspace), _count(0), _amount(0) {} bool process(Type* t) { if (t->retired()) { assert(!t->transient(), "invariant"); assert(!t->lease(), "invariant"); - assert(t->empty(), "invariant"); - assert(t->identity() == NULL, "invariant"); ++_count; _amount += t->total_size(); t->clear_retired(); _control.decrement_dead(); mspace_release_full_critical(t, _mspace); } return true; } --- 731,748 ---- public: typedef typename Mspace::Type Type; Scavenger(JfrStorageControl& control, Mspace* mspace) : _control(control), _mspace(mspace), _count(0), _amount(0) {} bool process(Type* t) { if (t->retired()) { + assert(t->identity() != NULL, "invariant"); + assert(t->empty(), "invariant"); assert(!t->transient(), "invariant"); assert(!t->lease(), "invariant"); ++_count; _amount += t->total_size(); t->clear_retired(); + t->release(); _control.decrement_dead(); mspace_release_full_critical(t, _mspace); } return true; }
< prev index next >