Returns a new barrier.
A positive fixnum or
returns a new barrier with count
, which is interpreted as
The barrier has the name
, which is useful for debugging but is not used otherwise. If
is omitted, then a default name is generated that is unique among all such default names.
determine the default behavior when a thread times out or aborts while in the function barrier-wait. See the documentation for barrier-wait.
is true, then barrier-wait will disable the barrier by default when it unblocks it. See
in the documentation for barrier-wait.
is called by barrier-wait just before it unblocks the barrier. It is called with a single argument (the barrier) while holding an internal lock on the barrier that will prevent other operations on the barrier from running. The callback is guaranteed to happen before barrier-wait allows any of the other threads to continue.
Because the callback is called inside a lock, you should ensure that it is relatively short to prevent congestion if another thread tries to access the barrier. Allocating a few objects is reasonable. If there is a more expensive operation that has to be done by only one of the threads, it can be done by the thread that returned
from barrier-wait. The advantage of using the callback is that it is called before any of the waiting threads pass the barrier.
LispWorks User Guide and Reference Manual - 22 Dec 2009