mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fixed monitorExit to work with more than one enter/exit.
This commit is contained in:
parent
2fbc50e76f
commit
e2b6b7b2df
|
@ -51,12 +51,15 @@ public class TObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void monitorExit(TObject o){
|
static void monitorExit(TObject o){
|
||||||
o.owner = null;
|
|
||||||
o.monitorCount--;
|
o.monitorCount--;
|
||||||
|
if ( o.monitorCount == 0 ){
|
||||||
if ( o.monitorLock != null ){
|
if ( o.monitorLock != null ){
|
||||||
|
o.owner = null;
|
||||||
o.monitorLock.notifyAll();
|
o.monitorLock.notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static boolean holdsLock(TObject o){
|
static boolean holdsLock(TObject o){
|
||||||
return o.owner == TThread.currentThread();
|
return o.owner == TThread.currentThread();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user