Notifies all waiting threads of a change in the object's state.
public:
static void PulseAll(System::Object ^ obj);
public static void PulseAll(object obj);
static member PulseAll : obj -> unit
Public Shared Sub PulseAll (obj As Object)
Parameters
The object that sends the pulse.
ExceptionsThe obj
parameter is null
.
The calling thread does not own the lock for the specified object.
RemarksThe thread that currently owns the lock on the specified object invokes this method to signal all threads waiting to acquire the lock on the object. After the signal is sent, the waiting threads are moved to the ready queue. When the thread that invoked PulseAll
releases the lock, the next thread in the ready queue acquires the lock.
Note that a synchronized object holds several references, including a reference to the thread that currently holds the lock, a reference to the ready queue, which contains the threads that are ready to obtain the lock, and a reference to the waiting queue, which contains the threads that are waiting for notification of a change in the object's state.
The Pulse, PulseAll
, and Wait methods must be invoked from within a synchronized block of code.
The remarks for the Pulse method explain what happens if Pulse is called when no threads are waiting.
To signal a single thread, use the Pulse
method.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4