Overview Module Function Class Tea 3.2.4 Reference Documentation
© 2009 PDM&FC

Function tea-lock-acquire

tea-lock-acquire lockName

Acquires a lock to enter an exclusive code section.

Parameters:
lockName - Symbol identifying the lock being acquired.

After returning from this function any other calls to tea-lock-aquire for the same lockName will block until the lock is released by calling tea-lock-release. The locks are global to the JVM meaning that they are meant to grant exclusive access to resources that may be used by all running threads.

Note that a deadlock will occur if you make two successive calls to tea-lock-acquire for the same lock in the same thread without calling tea-lock-release in between.

The functions tea-lock-acquire, tea-lock-release are only useful within code that may be executing by more than one interpreter, where each interpreter is running on a separate thread.


Overview Module Function Class Tea 3.2.4 Reference Documentation
© 2009 PDM&FC
Report a bug or request new features
© 2009