mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
deadlock on unshelve
This commit is contained in:
@@ -245,11 +245,11 @@ abstract class GeneralRunner implements ContinuationContext {
|
||||
@Nullable
|
||||
protected TaskDescriptor getNextMatching() {
|
||||
while (true) {
|
||||
if (myTriggerSuspend) {
|
||||
return null;
|
||||
}
|
||||
synchronized (myQueueLock) {
|
||||
if (myQueue.isEmpty()) return null;
|
||||
if (myTriggerSuspend) {
|
||||
return null;
|
||||
}
|
||||
TaskDescriptor current = myQueue.remove(0);
|
||||
// check if some tasks were scheduled after disaster was thrown, anyway, they should also be checked for cure
|
||||
if (! current.isHaveMagicCure()) {
|
||||
|
||||
@@ -68,16 +68,14 @@ public class SameProgressRunner extends GeneralRunner {
|
||||
|
||||
final TaskDescriptor current = getNextMatching();
|
||||
if (current == null) {
|
||||
synchronized (myQueueLock) {
|
||||
if (myTriggerSuspend) {
|
||||
mySemaphore.down();
|
||||
while (myTriggerSuspend) {
|
||||
mySemaphore.waitFor(500);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
return;
|
||||
if (myTriggerSuspend) {
|
||||
mySemaphore.down();
|
||||
while (myTriggerSuspend) {
|
||||
mySemaphore.waitFor(500);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user