Skip to content

Commit 7f4a3a3

Browse files
committed
fix
1 parent e6c8836 commit 7f4a3a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/docs.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -4667,6 +4667,7 @@ println(ch.try_push(42)) // `.success` if pushed, `.not_ready` if full, `.closed
46674667
println(ch.len) // Number of items in the buffer
46684668
println(ch.cap) // Buffer capacity
46694669
println(ch.closed) // Whether the channel is closed
4670+
```
46704671

46714672
```v
46724673
struct Abc {
@@ -4691,13 +4692,15 @@ algorithms based on them are often subject to race conditions. Especially `.len`
46914692
Use `or` branches, error propagation or `select` instead (see [Syntax and Usage](#syntax-and-usage)
46924693
and [Channel Select](#channel-select) above).
46934694

4694-
### Shared Objects
4695+
### Shared Objects (structs, arrays or maps)
46954696

46964697
Data can be exchanged between a thread and the calling thread via a shared variable.
46974698
Such variables should be created as `shared` and passed to the thread as such, too.
46984699
The underlying `struct` contains a hidden *mutex* that allows locking concurrent access
46994700
using `rlock` for read-only and `lock` for read/write access.
47004701

4702+
Note: Shared variables must be structs, arrays or maps.
4703+
47014704
#### Example of Shared Objects
47024705

47034706
```v

0 commit comments

Comments
 (0)