Method Signal():signal() Foundation

Posts a signal to wake up waiting threads.

Syntax
:signal() --> self
Return

This method returns self.

Description

The :signal() method posts the event semaphore, changing its state to signaled. This action releases threads that are currently waiting on this Signal object through the :wait() method.

When a signal is posted, at least one waiting thread will be released. If multiple threads are waiting, the operating system determines which thread(s) get released based on thread scheduling priorities.

The signal remains in the signaled state until a thread successfully waits on it with reset enabled (the default behavior), which then resets it back to non-signaled state. Multiple calls to :signal() while already in signaled state are allowed and harmless.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.