| LOCK(2) | System Calls Manual | LOCK(2) |
lock - thread locking.
include "lock.m";
lock := load Lock Lock->PATH;
Semaphore: adt {
c: chan of int;
obtain: fn(s: self ref Semaphore);
release: fn(s: self ref Semaphore);
new: fn(): ref Semaphore;
};
init: fn();
Lock provides semaphore-based mutual exclusion. Init must be called before creating any locks.
/appl/lib/lock.b