mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8156500: Move Reference pending list into VM to prevent deadlocks
Move reference pending list and locking into VM Co-authored-by: Per Liden <per.liden@oracle.com> Reviewed-by: coleenp, dholmes, dcubed, mchung, plevart
This commit is contained in:
parent
4f55b6c7e0
commit
66706edf15
29 changed files with 133 additions and 576 deletions
|
@ -28,7 +28,6 @@
|
|||
#include "gc/cms/concurrentMarkSweepThread.hpp"
|
||||
#include "gc/shared/gcId.hpp"
|
||||
#include "gc/shared/genCollectedHeap.hpp"
|
||||
#include "gc/shared/referencePendingListLocker.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/init.hpp"
|
||||
#include "runtime/interfaceSupport.hpp"
|
||||
|
@ -77,23 +76,6 @@ void ConcurrentMarkSweepThread::run_service() {
|
|||
log_warning(gc)("Couldn't bind CMS thread to processor " UINTX_FORMAT, CPUForCMSThread);
|
||||
}
|
||||
|
||||
{
|
||||
MutexLockerEx x(CGC_lock, true);
|
||||
set_CMS_flag(CMS_cms_wants_token);
|
||||
assert(is_init_completed() && Universe::is_fully_initialized(), "ConcurrentGCThread::run() should have waited for this.");
|
||||
|
||||
// Wait until the surrogate locker thread that will do
|
||||
// pending list locking on our behalf has been created.
|
||||
// We cannot start the SLT thread ourselves since we need
|
||||
// to be a JavaThread to do so.
|
||||
CMSLoopCountWarn loopY("CMS::run", "waiting for SLT installation", 2);
|
||||
while (!ReferencePendingListLocker::is_initialized() && !should_terminate()) {
|
||||
CGC_lock->wait(true, 200);
|
||||
loopY.tick();
|
||||
}
|
||||
clear_CMS_flag(CMS_cms_wants_token);
|
||||
}
|
||||
|
||||
while (!should_terminate()) {
|
||||
sleepBeforeNextCycle();
|
||||
if (should_terminate()) break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue