Share via


Monitor Class

Provides a mechanism that synchronizes access to objects.

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

Syntax

public static class Monitor

Remarks

The Monitor class controls access to objects by granting a lock for an object to a single thread. Object locks provide you with the ability to restrict access to a specific block of code, commonly called a critical section. While any one thread owns the lock for a particular object, no other thread can acquire that lock. You can also use the Monitor class to ensure that no other thread is permitted to access a section of application code being executed by the lock owner, unless the other thread is executing the code by using a different locked object.

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

Monitor Members
System.Threading Namespace