[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Create a new semaphore
Source position: threadh.inc line 178
function SemaphoreInit: Pointer; |
SemaphoreInit creates a new semaphore, which can be used in thread synchronization. The semaphore can be used with SemaphoreWait and SemaphorePost, and must be destroyed with SemaphoreDestroy.
The result is an untyped pointer (thread support is platform dependent).
The use of semaphores requires thread support (use #rtl.cthreads unit on unices).
On error, Pointer(-1) is returned. If no thread support is compiled in, then calling this function will result in a run-time error 232.
|
Initialize the thread manager with a POSIX thread manager |
|
|
Wait for semaphore to become available |
|
|
Make semaphore available |
|
|
Destroy a semaphore |