mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
coroutine_dispatchers.md: Add information about no write intent lock on Dispatchers.EDT since 2024.3
This commit is contained in:
parent
ae55090cbe
commit
ac3e36be7d
@ -67,6 +67,14 @@ In the IntelliJ Platform, the EDT dispatcher is also installed as `Dispatchers.M
|
||||
Use `Dispatchers.Main` only if the coroutine is IntelliJ Platform-context agnostic (e.g., when it can be executed outside the IntelliJ Platform context).
|
||||
Use `Dispatchers.EDT` when in doubt.
|
||||
|
||||
### EDT Dispatcher and Write Intent Lock
|
||||
|
||||
As explained in the [](threading_model.md#locks-and-edt) section, write intent lock is acquired on EDT implicitly.
|
||||
This behavior has changed in coroutine context in version 2024.3.
|
||||
|
||||
Since 2024.3, write intent lock is not acquired implicitly in coroutines called on the EDT dispatcher.
|
||||
Coroutines must use [`readAction`/`writeAction`/`writeIntentReadAction`](%gh-ic%/platform/core-api/src/com/intellij/openapi/application/coroutines.kt) API to acquire a required lock explicitly.
|
||||
|
||||
## Dispatchers vs. Threads
|
||||
|
||||
The dispatcher concept is a higher level of abstraction over threads.
|
||||
|
Loading…
x
Reference in New Issue
Block a user