This commit is contained in:
konsoletyper 2015-03-08 13:09:17 +03:00
parent cf983755b2
commit 3a78db74c1
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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);
}; };
}; };