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