mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 00:24:11 -08:00
Fix bugs
This commit is contained in:
parent
cf983755b2
commit
3a78db74c1
|
@ -196,7 +196,6 @@ public class TObject {
|
||||||
if (!holdsLock(this)) {
|
if (!holdsLock(this)) {
|
||||||
throw new TIllegalMonitorStateException();
|
throw new TIllegalMonitorStateException();
|
||||||
}
|
}
|
||||||
TThread thread = TThread.currentThread();
|
|
||||||
PlatformQueue<NotifyListener> listeners = monitor.notifyListeners;
|
PlatformQueue<NotifyListener> listeners = monitor.notifyListeners;
|
||||||
while (!listeners.isEmpty()) {
|
while (!listeners.isEmpty()) {
|
||||||
NotifyListener listener = listeners.remove();
|
NotifyListener listener = listeners.remove();
|
||||||
|
@ -205,7 +204,6 @@ public class TObject {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TThread.setCurrentThread(thread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Sync
|
@Sync
|
||||||
|
@ -256,6 +254,7 @@ public class TObject {
|
||||||
final TThread currentThread = TThread.currentThread();
|
final TThread currentThread = TThread.currentThread();
|
||||||
int timerId = -1;
|
int timerId = -1;
|
||||||
boolean expired;
|
boolean expired;
|
||||||
|
boolean performed;
|
||||||
int lockCount;
|
int lockCount;
|
||||||
|
|
||||||
public NotifyListenerImpl(TObject obj, AsyncCallback<Void> callback, int lockCount) {
|
public NotifyListenerImpl(TObject obj, AsyncCallback<Void> callback, int lockCount) {
|
||||||
|
@ -280,6 +279,10 @@ public class TObject {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (performed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
performed = true;
|
||||||
if (timerId >= 0) {
|
if (timerId >= 0) {
|
||||||
Platform.killSchedule(timerId);
|
Platform.killSchedule(timerId);
|
||||||
timerId = -1;
|
timerId = -1;
|
||||||
|
|
|
@ -497,7 +497,11 @@ function $rt_continue(f) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var args = arguments;
|
var args = arguments;
|
||||||
var thread = $rt_getThread();
|
var thread = $rt_getThread();
|
||||||
|
var oldPostponed = thread.postponed;
|
||||||
thread.postponed = function() {
|
thread.postponed = function() {
|
||||||
|
if (oldPostponed) {
|
||||||
|
oldPostponed();
|
||||||
|
}
|
||||||
f.apply(self, args);
|
f.apply(self, args);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user