1
0
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:
Uwe Krüger
2020-07-07 01:57:31 +02:00
committed by GitHub
parent 013c0e6e16
commit ef02373061
14 changed files with 70 additions and 96 deletions

View File

@@ -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*,