mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: remove rwshared
keyword, make its semantics default for shared
(#5710)
This commit is contained in:
@@ -35,13 +35,20 @@ atomic d := ...
|
||||
- `c` can be passed to coroutines an accessed
|
||||
*concurrently*.<sup>2</sup> In order to avoid data races it has to
|
||||
be locked before access can occur and unlocked to allow access to
|
||||
other coroutines. This is done by the following block structure:
|
||||
other coroutines. This is done by one the following block structures:
|
||||
```v
|
||||
lock c {
|
||||
// read, modify, write c
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
```v
|
||||
rlock c {
|
||||
// read c
|
||||
...
|
||||
}
|
||||
```
|
||||
Several variables may be specified: `lock x, y, z { ... }`.
|
||||
They are unlocked in the opposite order.
|
||||
- `d` can be passed to coroutines and accessed *concurrently*,
|
||||
|
Reference in New Issue
Block a user