Remove dead code about implicitRead().

GitOrigin-RevId: 204546b39342850ed5375e51a8bea3404f90ba90
This commit is contained in:
Lev Serebryakov
2024-09-04 15:04:09 +00:00
committed by intellij-monorepo-bot
parent 972ae67cc4
commit ca376835a0
6 changed files with 5 additions and 71 deletions
@@ -64,24 +64,6 @@ interface ThreadingSupport {
@ApiStatus.Internal
fun isWriteIntentLocked(): Boolean
/**
* Runs specified action with disabled implicit read lock if this feature is enabled with system property.
*
* @see com.intellij.idea.StartupUtil.isImplicitReadOnEDTDisabled
* @param runnable action to run with disabled implicit read lock.
*/
@ApiStatus.Internal
fun runWithoutImplicitRead(runnable: Runnable)
/**
* Runs specified action with enabled implicit read lock if this feature is enabled with system property.
*
* @see com.intellij.idea.StartupUtil.isImplicitReadOnEDTDisabled
* @param runnable action to run with enabled implicit read lock.
*/
@ApiStatus.Internal
fun runWithImplicitRead(runnable: Runnable)
/**
* Requests pooled thread to execute the action.
*
@@ -225,26 +225,6 @@ public interface ApplicationEx extends Application {
@ApiStatus.Internal
<T> @Nullable T getServiceByClassName(@NotNull String serviceClassName);
/**
* Runs specified action with disabled implicit read lock if this feature is enabled with system property.
* @see com.intellij.platform.ide.bootstrap.StartupUtil#isImplicitReadOnEDTDisabled() StartupUtil.isImplicitReadOnEDTDisabled()
* @param runnable action to run with disabled implicit read lock.
*/
@ApiStatus.Internal
default void runWithoutImplicitRead(@NotNull Runnable runnable) {
runnable.run();
}
/**
* Runs specified action with enabled implicit read lock if this feature is disabled with system property.
* @see com.intellij.platform.ide.bootstrap.StartupUtil#isImplicitReadOnEDTDisabled() StartupUtil.isImplicitReadOnEDTDisabled()
* @param runnable action to run with enabled implicit read lock.
*/
@ApiStatus.Internal
default void runWithImplicitRead(@NotNull Runnable runnable) {
runnable.run();
}
/**
* @deprecated Use {@link com.intellij.ide.IdeEventQueue#flushNativeEventQueue IdeEventQueue.flushNativeEventQueue()}
*/
@@ -5,8 +5,6 @@ import com.intellij.concurrency.ContextAwareRunnable;
import com.intellij.diagnostic.EventWatcher;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.diagnostic.ThrottledLogger;
import com.intellij.openapi.progress.ProcessCanceledException;
@@ -32,14 +30,13 @@ final class FlushQueue {
synchronized (getQueueLock()) {
FLUSHER_SCHEDULED = false;
}
ApplicationEx app = ApplicationManagerEx.getApplicationEx();
long startTime = System.currentTimeMillis();
while (true) {
RunnableInfo info = pollNextEvent();
if (info == null) {
break;
}
runNextEvent(info, app);
runNextEvent(info);
if (InvocationUtil.priorityEventPending() || System.currentTimeMillis() - startTime > 5) {
synchronized (getQueueLock()) {
requestFlush();
@@ -74,11 +71,6 @@ final class FlushQueue {
}
}
// Extracted to have a capture point
private static void doRun(@Async.Execute @NotNull RunnableInfo info, @NotNull ApplicationEx app) {
app.runWithImplicitRead(info.runnable);
}
@Override
public String toString() {
synchronized (getQueueLock()) {
@@ -113,11 +105,11 @@ final class FlushQueue {
}
}
private static void runNextEvent(@NotNull RunnableInfo info, @NotNull ApplicationEx app) {
private static void runNextEvent(@NotNull RunnableInfo info) {
final EventWatcher watcher = EventWatcher.getInstanceOrNull();
final long waitingFinishedNs = System.nanoTime();
try {
doRun(info, app);
info.runnable.run();
}
catch (ProcessCanceledException ignored) {
@@ -584,9 +584,9 @@ class IdeEventQueue private constructor() : EventQueue() {
(app.serviceIfCreated<WindowManager>() as? WindowManagerEx)?.dispatchComponentEvent(e)
}
}
threadingSupport.runWithoutImplicitRead { defaultDispatchEvent(e) }
defaultDispatchEvent(e)
}
else -> threadingSupport.runWithoutImplicitRead { defaultDispatchEvent(e) }
else -> defaultDispatchEvent(e)
}
}
@@ -116,16 +116,6 @@ internal object AnyThreadWriteThreadingSupport: ThreadingSupport {
return myState.get().hasPermit
}
override fun runWithoutImplicitRead(runnable: Runnable) {
// There is no implicit read, as there is no write thread anymore
runnable.run()
}
override fun runWithImplicitRead(runnable: Runnable) {
// There is no implicit read, as there is no write thread anymore
runnable.run()
}
override fun executeOnPooledThread(action: Runnable, expired: BooleanSupplier): Future<*> {
val actionDecorated = decorateRunnable(action)
return AppExecutorUtil.getAppExecutorService().submit(object : Runnable {
@@ -1136,16 +1136,6 @@ public final class ApplicationImpl extends ClientAwareComponentManager implement
return getContainerState().get().compareTo(ContainerState.COMPONENT_CREATED) >= 0;
}
@Override
public void runWithoutImplicitRead(@NotNull Runnable runnable) {
getThreadingSupport().runWithoutImplicitRead(runnable);
}
@Override
public void runWithImplicitRead(@NotNull Runnable runnable) {
getThreadingSupport().runWithImplicitRead(runnable);
}
@ApiStatus.Internal
public static void postInit(@NotNull ApplicationImpl app) {
AtomicBoolean reported = new AtomicBoolean();