Locking Statements

A locking statement protects a block of code to be only run from a single thread at a time.


var mylock := new Object;
locking mylock do begin
  // thread sensitive operations.

Limitation on Island

locking statements and locking Expressions are limited to work on Monitor classes, on the Island-based platforms. On the other platforms, any type can be locked on.

See Also