mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fix infinite lock when overriding Thread.run and then joining it
This commit is contained in:
parent
cc04c3446d
commit
8fbf62ebac
|
@ -62,6 +62,9 @@ public class TThread extends TObject implements TRunnable {
|
|||
setCurrentThread(TThread.this);
|
||||
TThread.this.run();
|
||||
} finally {
|
||||
synchronized (finishedLock) {
|
||||
finishedLock.notifyAll();
|
||||
}
|
||||
alive = false;
|
||||
activeCount--;
|
||||
setCurrentThread(mainThread);
|
||||
|
@ -85,9 +88,6 @@ public class TThread extends TObject implements TRunnable {
|
|||
if (target != null) {
|
||||
target.run();
|
||||
}
|
||||
synchronized (finishedLock) {
|
||||
finishedLock.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
public static TThread currentThread() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user