chickadee » synch » make-exchanger

make-exchanger OBJprocedure

Returns a new exchanger with the argument OBJ as its initial content.

An exchanger is a procedure of one argument regulating mutually exclusive access to a resource. When a exchanger is called, its current content is returned, while being replaced by its argument in an atomic operation.

From SRFI-96 Mutual Exclusion; see https://srfi.schemers.org/s/srfi-96.html.