mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
threading_model.md: Rename readers-writer lock to read-write lock
This commit is contained in:
parent
1596f6072c
commit
7f44b101df
@ -16,7 +16,7 @@
|
||||
the Threading section:
|
||||
</p>
|
||||
<list>
|
||||
<li><a href="threading_model.md#readers-writer-lock">Read-Write Lock</a></li>
|
||||
<li><a href="threading_model.md#read-write-lock">Read-Write Lock</a></li>
|
||||
<li><a href="threading_model.md#read-action-cancellability">Read Action Cancellability</a></li>
|
||||
</list>
|
||||
|
||||
|
@ -26,11 +26,11 @@ Executing on BGT from EDT can be achieved with [background processes](background
|
||||
>
|
||||
{style="warning"}
|
||||
|
||||
## Readers-Writer Lock
|
||||
## Read-Write Lock
|
||||
|
||||
The IntelliJ Platform data structures (such as [Program Structure Interface](psi.md), [Virtual File System](virtual_file_system.md), or [Project root model](project_structure.md)) aren't thread-safe.
|
||||
Accessing them requires a synchronization mechanism ensuring that all threads see the data in a consistent and up-to-date state.
|
||||
This is implemented with a single application-wide [readers-writer (RW) lock](https://w.wiki/7dBy) that must be acquired by threads requiring reading or writing to data models.
|
||||
This is implemented with a single application-wide [read-write (RW) lock](https://w.wiki/7dBy) that must be acquired by threads requiring reading or writing to data models.
|
||||
|
||||
If a thread requires accessing a data model, it must acquire one of the locks:
|
||||
|
||||
|
@ -78,7 +78,7 @@ If there is some code that needs to be executed after the refresh is complete, t
|
||||
* [`RefreshQueue.createSession()`](%gh-ic%/platform/analysis-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java)
|
||||
* [`VirtualFile.refresh()`](%gh-ic%/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java)
|
||||
|
||||
In some cases, synchronous refreshes can cause deadlocks, depending on which [locks](threading_model.md#readers-writer-lock) are held by the thread invoking the refresh operation.
|
||||
In some cases, synchronous refreshes can cause deadlocks, depending on which [locks](threading_model.md#read-write-lock) are held by the thread invoking the refresh operation.
|
||||
|
||||
## Virtual File System Events
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user