use of com.oracle.truffle.espresso.blocking.EspressoLock in project graal by oracle.
the class EspressoReferenceDrainer method doWaitForReferencePendingList.
@TruffleBoundary
private void doWaitForReferencePendingList() {
try {
EspressoLock pLock = getLock();
pLock.lock();
try {
// Wait until the reference drain updates the list.
while (!hasReferencePendingList()) {
pLock.await(0L);
}
} finally {
pLock.unlock();
}
} catch (GuestInterruptedException e) {
/*
* The guest handler thread will attempt emptying the reference list by re-obtaining it.
* If the list is not null, then everything will proceed as normal. In the case it is
* empty, the guest handler will simply loop back into waiting. This looping back into
* waiting done in guest code gives us a chance to reach an espresso safe point (a back
* edge), thus giving us the possibility to stop this thread when tearing down the VM.
*/
}
}
Aggregations