public class SingleThreadedMonitorSupport extends MonitorSupport
| Constructor and Description |
|---|
SingleThreadedMonitorSupport() |
| Modifier and Type | Method and Description |
|---|---|
int |
countThreadLock(org.graalvm.nativeimage.IsolateThread vmThread) |
void |
doRelockObject(Object obj,
Object lockData) |
protected void |
doWait(Object obj,
long timeoutMillis) |
boolean |
isLockedByAnyThread(Object obj)
Determines whether the object's monitor is locked by the current or any other thread.
|
boolean |
isLockedByCurrentThread(Object obj)
Implements the semantics of
Thread.holdsLock(java.lang.Object). |
int |
maybeAdjustNewParkStatus(int status)
Called from
Unsafe.park when changing the current thread's state before parking the
thread. |
void |
monitorEnter(Object obj)
Implements the semantics of the monitorenter bytecode.
|
void |
monitorExit(Object obj)
Implements the semantics of the monitorexit bytecode.
|
void |
notify(Object obj,
boolean notifyAll)
Implements the semantics of
Object.notify() and Object.notifyAll(). |
Object |
prepareRelockObject(Object obj) |
singleton, waitpublic void monitorEnter(Object obj)
MonitorSupportmonitorEnter in class MonitorSupportpublic void monitorExit(Object obj)
MonitorSupportmonitorExit in class MonitorSupportpublic Object prepareRelockObject(Object obj)
prepareRelockObject in class MonitorSupportpublic void doRelockObject(Object obj, Object lockData)
doRelockObject in class MonitorSupportpublic boolean isLockedByCurrentThread(Object obj)
MonitorSupportThread.holdsLock(java.lang.Object).isLockedByCurrentThread in class MonitorSupportpublic boolean isLockedByAnyThread(Object obj)
MonitorSupportisLockedByAnyThread in class MonitorSupportpublic int countThreadLock(org.graalvm.nativeimage.IsolateThread vmThread)
countThreadLock in class MonitorSupportprotected void doWait(Object obj, long timeoutMillis) throws InterruptedException
doWait in class MonitorSupportInterruptedExceptionpublic void notify(Object obj, boolean notifyAll)
MonitorSupportObject.notify() and Object.notifyAll().notify in class MonitorSupportpublic int maybeAdjustNewParkStatus(int status)
MonitorSupportUnsafe.park when changing the current thread's state before parking the
thread. When the thread is parked due to a monitor operation, we need to alter the new thread
state so Thread.getState() gives the expected result.maybeAdjustNewParkStatus in class MonitorSupport