src/share/vm/gc_implementation/g1/ptrQueue.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Wed Jan 15 01:41:02 2014
--- new/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Wed Jan 15 01:41:02 2014

*** 69,79 **** --- 69,79 ---- void PtrQueue::locking_enqueue_completed_buffer(void** buf) { assert(_lock->owned_by_self(), "Required."); // We have to unlock _lock (which may be Shared_DirtyCardQ_lock) before ! // we acquire DirtyCardQ_CBL_mon inside enqeue_complete_buffer as they ! // we acquire DirtyCardQ_CBL_mon inside enqueue_complete_buffer as they // have the same rank and we may get the "possible deadlock" message _lock->unlock(); qset()->enqueue_complete_buffer(buf); // We must relock only because the caller will unlock, for the normal
*** 149,159 **** --- 149,159 ---- if (_lock) { assert(_lock->owned_by_self(), "Required."); // The current PtrQ may be the shared dirty card queue and // may be being manipulated by more than one worker thread ! // during a pause. Since the enqueuing of the completed ! // during a pause. Since the enqueueing of the completed // buffer unlocks the Shared_DirtyCardQ_lock more than one // worker thread can 'race' on reading the shared queue attributes // (_buf and _index) and multiple threads can call into this // routine for the same buffer. This will cause the completed // buffer to be added to the CBL multiple times.
*** 168,178 **** --- 168,178 ---- void** buf = _buf; // local pointer to completed buffer _buf = NULL; // clear shared _buf field locking_enqueue_completed_buffer(buf); // enqueue completed buffer ! // While the current thread was enqueuing the buffer another thread ! // While the current thread was enqueueing the buffer another thread // may have a allocated a new buffer and inserted it into this pointer // queue. If that happens then we just return so that the current // thread doesn't overwrite the buffer allocated by the other thread // and potentially losing some dirtied cards.

src/share/vm/gc_implementation/g1/ptrQueue.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File