.NET Framework Class Library
Monitor..::.PulseAll Method

Notifies all waiting threads of a change in the object's state.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)
Syntax

Visual Basic (Declaration)
Public Shared Sub PulseAll ( _
    obj As Object _
)
Visual Basic (Usage)
Dim obj As Object

Monitor.PulseAll(obj)
C#
public static void PulseAll(
    Object obj
)
Visual C++
public:
static void PulseAll(
    Object^ obj
)
JScript
public static function PulseAll(
    obj : Object
)

Parameters

obj
Type: System..::.Object
The object that sends the pulse.
Exceptions

ExceptionCondition
ArgumentNullException

The obj parameter is nullNothingnullptra null reference (Nothing in Visual Basic).

SynchronizationLockException

The calling thread does not own the lock for the specified object.

Remarks

The 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.

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
See Also

Reference

Other Resources

Tags :


Page view tracker