From d254beda2b5d05f2718ef6647d78839d36d43e66 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Tue, 30 Jul 2024 16:34:33 +0200 Subject: [PATCH] Update General Threading Rules to Threading Model (labels and links) GitOrigin-RevId: 45406f37f0c5387267708a880de123bd7972f5ac --- .../src/com/intellij/openapi/application/Application.java | 2 +- .../src/com/intellij/openapi/application/ReadAction.java | 2 +- .../src/com/intellij/openapi/application/WriteAction.java | 2 +- .../intellij/openapi/application/WriteIntentReadAction.java | 2 +- .../concurrency/annotations/RequiresBackgroundThread.java | 2 +- .../intellij/util/concurrency/annotations/RequiresEdt.java | 2 +- .../util/concurrency/annotations/RequiresReadLock.java | 2 +- .../util/concurrency/annotations/RequiresReadLockAbsence.java | 4 ++-- .../util/concurrency/annotations/RequiresWriteLock.java | 2 +- .../src/com/intellij/openapi/components/ComponentManager.java | 2 +- .../intellij/openapi/progress/ProcessCanceledException.java | 4 ++-- .../inspectionDescriptions/CancellationCheckInLoops.html | 2 +- .../idea/devkit/threadingModelHelper/TMHIntegrationTest.java | 4 ++-- .../kotlin/idea/base/util/CheckCancelledLockUtils.kt | 4 ++-- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/platform/core-api/src/com/intellij/openapi/application/Application.java b/platform/core-api/src/com/intellij/openapi/application/Application.java index 5ae0ae43fdbd..05a647bdcba1 100644 --- a/platform/core-api/src/com/intellij/openapi/application/Application.java +++ b/platform/core-api/src/com/intellij/openapi/application/Application.java @@ -51,7 +51,7 @@ import java.util.concurrent.Future; *

* If there are read actions running at this moment {@code runWriteAction} is blocked until they are completed. *

- * See also General Threading Rules. + * See also Threading Model. */ public interface Application extends ComponentManager { diff --git a/platform/core-api/src/com/intellij/openapi/application/ReadAction.java b/platform/core-api/src/com/intellij/openapi/application/ReadAction.java index cd1b2227c1ec..00cc7f545320 100644 --- a/platform/core-api/src/com/intellij/openapi/application/ReadAction.java +++ b/platform/core-api/src/com/intellij/openapi/application/ReadAction.java @@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull; import java.util.concurrent.Callable; /** - * See General Threading Rules + * See Threading Model * * @param Result type. * @see WriteAction diff --git a/platform/core-api/src/com/intellij/openapi/application/WriteAction.java b/platform/core-api/src/com/intellij/openapi/application/WriteAction.java index 5141db739289..821129467721 100644 --- a/platform/core-api/src/com/intellij/openapi/application/WriteAction.java +++ b/platform/core-api/src/com/intellij/openapi/application/WriteAction.java @@ -15,7 +15,7 @@ import javax.swing.*; import java.util.concurrent.atomic.AtomicReference; /** - * See General Threading Rules + * See Threading Model * * @param Result type. * @see ReadAction diff --git a/platform/core-api/src/com/intellij/openapi/application/WriteIntentReadAction.java b/platform/core-api/src/com/intellij/openapi/application/WriteIntentReadAction.java index 85fe645138c7..0290895cc5eb 100644 --- a/platform/core-api/src/com/intellij/openapi/application/WriteIntentReadAction.java +++ b/platform/core-api/src/com/intellij/openapi/application/WriteIntentReadAction.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; /** - * See General Threading Rules + * See Threading Model * * @see ReadAction * @see WriteAction diff --git a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresBackgroundThread.java b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresBackgroundThread.java index 337334d66c9d..684601c3c68a 100644 --- a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresBackgroundThread.java +++ b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresBackgroundThread.java @@ -20,7 +20,7 @@ import java.lang.annotation.*; * Important: the instrumentation has limitations. Please read the docs * of the {@link org.jetbrains.jps.devkit.threadingModelHelper} to learn about them. * - * @see General Threading Rules + * @see Threading Model * @see Application#assertIsNonDispatchThread() * @see Application#executeOnPooledThread(Runnable) * @see Task.Backgroundable diff --git a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresEdt.java b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresEdt.java index a818f964abe7..8c6fd963d219 100644 --- a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresEdt.java +++ b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresEdt.java @@ -18,7 +18,7 @@ import java.lang.annotation.*; * Important: the instrumentation has limitations. Please read the docs * of the {@link org.jetbrains.jps.devkit.threadingModelHelper} to learn about them. * - * @see General Threading Rules + * @see Threading Model * @see Application#assertIsDispatchThread() * @see Application#invokeLater(Runnable, ModalityState) * @see Application#invokeAndWait(Runnable, ModalityState) diff --git a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLock.java b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLock.java index 3daec0b08344..2ee5f83d1291 100644 --- a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLock.java +++ b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLock.java @@ -19,7 +19,7 @@ import java.lang.annotation.*; * Important: the instrumentation has limitations. Please read the docs * of the {@link org.jetbrains.jps.devkit.threadingModelHelper} to learn about them. * - * @see General Threading Rules + * @see Threading Model * @see ThreadingAssertions#assertReadAccess() * @see ReadAction#run(ThrowableRunnable) */ diff --git a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLockAbsence.java b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLockAbsence.java index 727315935090..4989b8003d57 100644 --- a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLockAbsence.java +++ b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresReadLockAbsence.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.util.concurrency.annotations; import com.intellij.openapi.application.Application; @@ -20,7 +20,7 @@ import java.lang.annotation.*; * Important: the instrumentation has limitations. Please read the docs * of the {@link org.jetbrains.jps.devkit.threadingModelHelper} to learn about them. * - * @see General Threading Rules + * @see Threading Model * @see Application#assertReadAccessNotAllowed() * @see ReadAction#run(ThrowableRunnable) */ diff --git a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresWriteLock.java b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresWriteLock.java index f522799210fb..2fe397d001e6 100644 --- a/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresWriteLock.java +++ b/platform/core-api/src/com/intellij/util/concurrency/annotations/RequiresWriteLock.java @@ -19,7 +19,7 @@ import java.lang.annotation.*; * Important: the instrumentation has limitations. Please read the docs * of the {@link org.jetbrains.jps.devkit.threadingModelHelper} to learn about them. * - * @see General Threading Rules + * @see Threading Model * @see Application#assertWriteAccessAllowed() * @see WriteAction#run(ThrowableRunnable) */ diff --git a/platform/extensions/src/com/intellij/openapi/components/ComponentManager.java b/platform/extensions/src/com/intellij/openapi/components/ComponentManager.java index d14e7ebc1754..b62d9a1361c6 100644 --- a/platform/extensions/src/com/intellij/openapi/components/ComponentManager.java +++ b/platform/extensions/src/com/intellij/openapi/components/ComponentManager.java @@ -71,7 +71,7 @@ public interface ComponentManager extends UserDataHolder, Disposable, AreaInstan * or is about to be disposed (e.g. the {@link com.intellij.openapi.project.impl.ProjectExImpl#dispose()} was called but not completed yet) *
* The result is only valid inside read action because the application/project/module can be disposed at any moment. - * (see more details on read actions) + * (see more details on read actions) */ boolean isDisposed(); diff --git a/platform/util/base/src/com/intellij/openapi/progress/ProcessCanceledException.java b/platform/util/base/src/com/intellij/openapi/progress/ProcessCanceledException.java index 011984f0a2f7..4841d0ef5b71 100644 --- a/platform/util/base/src/com/intellij/openapi/progress/ProcessCanceledException.java +++ b/platform/util/base/src/com/intellij/openapi/progress/ProcessCanceledException.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.progress; import com.intellij.openapi.diagnostic.ControlFlowException; @@ -20,7 +20,7 @@ import java.util.concurrent.CancellationException; *

* * @see com.intellij.openapi.progress.ProgressIndicator#checkCanceled() - * @see General Threading Rules + * @see Threading Model */ public class ProcessCanceledException extends CancellationException implements ControlFlowException { public ProcessCanceledException() { } diff --git a/plugins/devkit/devkit-core/resources/inspectionDescriptions/CancellationCheckInLoops.html b/plugins/devkit/devkit-core/resources/inspectionDescriptions/CancellationCheckInLoops.html index 9e2ec5981f2f..69a00821b3e0 100644 --- a/plugins/devkit/devkit-core/resources/inspectionDescriptions/CancellationCheckInLoops.html +++ b/plugins/devkit/devkit-core/resources/inspectionDescriptions/CancellationCheckInLoops.html @@ -40,7 +40,7 @@ fun doSomething() { while com.intellij.openapi.progress.CoroutinesKt.checkCancelled() should be used in suspending one.

- See Background Processes and ProcessCanceledException in IntelliJ Platform Plugin SDK docs for more details. + See Background Processes Cancellation in IntelliJ Platform Plugin SDK docs for more details.

diff --git a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/threadingModelHelper/TMHIntegrationTest.java b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/threadingModelHelper/TMHIntegrationTest.java index 3dd24a9fd28b..f2601c754d29 100644 --- a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/threadingModelHelper/TMHIntegrationTest.java +++ b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/threadingModelHelper/TMHIntegrationTest.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.idea.devkit.threadingModelHelper; import com.intellij.openapi.application.Application; @@ -28,7 +28,7 @@ import static com.intellij.util.concurrency.ThreadingAssertions.*; * Note that if this happens, you need to update the instrumenter and install the updated version of the devkit to IDEA. *

* - * @see General Threading Rules + * @see Threading Model */ public class TMHIntegrationTest extends LightPlatformTestCase { private ExecutorService mySingleThreadExecutor; diff --git a/plugins/kotlin/base/util/src/org/jetbrains/kotlin/idea/base/util/CheckCancelledLockUtils.kt b/plugins/kotlin/base/util/src/org/jetbrains/kotlin/idea/base/util/CheckCancelledLockUtils.kt index 43c98913ab3a..ff7518127368 100644 --- a/plugins/kotlin/base/util/src/org/jetbrains/kotlin/idea/base/util/CheckCancelledLockUtils.kt +++ b/plugins/kotlin/base/util/src/org/jetbrains/kotlin/idea/base/util/CheckCancelledLockUtils.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. @file:JvmName("CheckCancelledLockUtils") package org.jetbrains.kotlin.idea.base.util @@ -29,7 +29,7 @@ inline fun ReentrantReadWriteLock.writeWithCheckCanceled(action: () -> T): T /** * It is preferable to use [CheckCanceledLock] instead of [ReentrantLock] in case of mix of - * [IntelliJ Read-Write locks](https://plugins.jetbrains.com/docs/intellij/general-threading-rules.html) and regular locks. + * [IntelliJ Read-Write locks](https://plugins.jetbrains.com/docs/intellij/threading-model.html) and regular locks. * * To acquire lock has to be cancellable action as read actions. */