mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use other thread instead of EDT as an argument to notifyThreadBusy to avoid tests crash
This commit is contained in:
+5
-1
@@ -221,7 +221,11 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
gatherStatistics = LOG.isDebugEnabled() || isUnitTestMode() || isInternal();
|
||||
|
||||
Thread edt = UIUtil.invokeAndWaitIfNeeded(() -> {
|
||||
AWTAutoShutdown.getInstance().notifyThreadBusy(Thread.currentThread()); // needed for EDT not to exit suddenly
|
||||
// instantiate AppDelayQueue which starts "Periodic task thread" which we'll mark busy to prevent this EDT to die
|
||||
// that thread was chosen because we know for sure it's running
|
||||
AppScheduledExecutorService service = (AppScheduledExecutorService)AppExecutorUtil.getAppScheduledExecutorService();
|
||||
Thread thread = service.getPeriodicTasksThread();
|
||||
AWTAutoShutdown.getInstance().notifyThreadBusy(thread); // needed for EDT not to exit suddenly
|
||||
return Thread.currentThread();
|
||||
});
|
||||
myLock = new ReadMostlyRWLock(edt);
|
||||
|
||||
@@ -84,4 +84,8 @@ class AppDelayQueue extends DelayQueue<SchedulingWrapper.MyScheduledFutureTask>
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
Thread getThread() {
|
||||
return scheduledToPooledTransferer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,4 +208,8 @@ public class AppScheduledExecutorService extends SchedulingWrapper {
|
||||
error();
|
||||
}
|
||||
}
|
||||
@NotNull
|
||||
public Thread getPeriodicTasksThread() {
|
||||
return delayQueue.getThread();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user