From Xojo Documentation



Supported for all project types and targets.

Call Signal to obtain a lock on a resource, blocking until it does. Once you are done with the shared resource, call Release to decrement the internal counter.


Every time a thread calls Signal, the Semaphore decrements the counter. If the counter is less than zero, it suspends the thread.

When you obtain a lock, you can use the resource. If the call succeeds, this function returns immediately and you code continues to execute. If the lock is not available, then the thread that called this method will wait until the lock becomes available. When you are finished using the resource, call the Release method to give it back to the Semaphore.