Handbook
Glossary
acquire-write-lock ( lock timeout -- )
Vocabulary
concurrency
.
locks
.
private
Inputs
lock
an
object
timeout
an
object
Outputs
None
Definition
USING:
accessors
concurrency.conditions
kernel
math
threads
;
IN:
concurrency.locks.private
:
acquire-write-lock
( lock timeout -- )
over
writer>>
pick
reader#>>
0
>
or
[
2dup
[
writers>>
]
dip
"write lock"
wait
]
when
drop
self
>>writer
drop
;