mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+14
-18
@@ -1206,24 +1206,20 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
ActivityTracker.getInstance().inc();
|
||||
fireBeforeWriteActionStart(clazz);
|
||||
|
||||
if (!myLock.isWriteLocked()) {
|
||||
if (!myLock.tryWriteLock()) {
|
||||
Future<?> reportSlowWrite = ourDumpThreadsOnLongWriteActionWaiting <= 0 ? null :
|
||||
JobScheduler.getScheduler().scheduleWithFixedDelay(() -> PerformanceWatcher.getInstance().dumpThreads("waiting", true),
|
||||
ourDumpThreadsOnLongWriteActionWaiting,
|
||||
ourDumpThreadsOnLongWriteActionWaiting, TimeUnit.MILLISECONDS);
|
||||
long t = 0;
|
||||
if (LOG.isDebugEnabled()) {
|
||||
t = System.currentTimeMillis();
|
||||
}
|
||||
myLock.writeLock();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
long elapsed = System.currentTimeMillis() - t;
|
||||
LOG.debug("Write action wait time: " + elapsed);
|
||||
}
|
||||
if (reportSlowWrite != null) {
|
||||
reportSlowWrite.cancel(false);
|
||||
}
|
||||
if (!myLock.isWriteLocked() && !myLock.tryWriteLock()) {
|
||||
Future<?> reportSlowWrite = ourDumpThreadsOnLongWriteActionWaiting <= 0 ? null :
|
||||
JobScheduler.getScheduler()
|
||||
.scheduleWithFixedDelay(() -> PerformanceWatcher.getInstance().dumpThreads("waiting", true),
|
||||
ourDumpThreadsOnLongWriteActionWaiting,
|
||||
ourDumpThreadsOnLongWriteActionWaiting, TimeUnit.MILLISECONDS);
|
||||
long t = LOG.isDebugEnabled() ? System.currentTimeMillis() : 0;
|
||||
myLock.writeLock();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
long elapsed = System.currentTimeMillis() - t;
|
||||
LOG.debug("Write action wait time: " + elapsed);
|
||||
}
|
||||
if (reportSlowWrite != null) {
|
||||
reportSlowWrite.cancel(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user