The function barrier-block-and-wait
enables the barrier barrier with t
, that is it makes any number of arrivers wait, and then waits until count arrivers arrive.
wait-if-used-p controls whether to wait if another process is already inside barrier-block-and-wait
. The default value of wait-if-used-p is nil
.
barrier is a barrier made by make-barrier.
errorp controls whether to signal an error if another process is already inside barrier-block-and-wait
and wait-if-used-p is nil
. The default value of errorp is nil
.
timeout, if non-nil, specifies the time in seconds to wait before timing out. The default value of timeout is nil
.
unblock specifies whether processes that already wait on barrier should be unblocked first. The default value of unblock is nil
.
barrier-block-and-wait
is "using" barrier, and only one process can do this the same time. barrier-block-and-wait
first tries to mark barrier as used by the current process, which will fail if another process is inside barrier-block-and-wait
with the same barrier. In this case it does one of three options:
error
.Once barrier-block-and-wait
has successfully marked barrier as used, it changes its count to t
as if by calling (barrier-change-count
barrier t)
, which will cause other barrier-wait calls to wait. If unblock is non-nil, it first unblocks all processes that wait on the barrier, so the effect is the same as (barrier-enable
barrier t)
.
It then waits until the arriver count of barrier is greater than or equal to count, or, if timeout is supplied, timeout seconds passed. It then returns the number of arrivers.
result can be one of three types:
The call was successful, and result is the number of arrivers.
barrier was in use, and wait-if-used-p is non-nil, so barrier-wait was called. result is the result of barrier-wait.
barrier is in use, and result is the process that uses it.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4