NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Monitor Members

Public:

Methods

Enter Obtains the monitor lock for an object. Will block if another thread holds the lock. Will not block if the current thread holds the lock, however the caller must ensure that the same number of Exit calls are made as there were Enter calls.

Enter the Monitor for an object. An object is passed as a parameter. This call will block if another thread has entered the Monitor of the same object. It will not block if the current thread has previously entered the Monitor, however the caller must ensure that the same number of Exit calls are made as there were Enter calls.

Interrupt can interrupt threads waiting to enter a Monitor on an object. A ThreadInterruptedException will be thrown.

Equals (inherited from Object) Determines whether the specified Object is the same instance as the current Object. Subclasses are expected to override this method to support value equality (not reference equality).
Exit Releases the monitor lock. If one or more threads are waiting to acquire the lock, and the current thread has executed Exit as many times as it has executed Enter, one of the threads will be unblocked and allowed to proceed.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) Gets the Type of the Object.
Pulse Notifies a thread in the waiting queue of a change in the object's state.
PulseAll Sends a notification to all waiting objects.
ToString (inherited from Object) Returns a String that represents the current Object.
TryEnter Overloaded. Similar to Enter, but will never block, or will only block for a certain amount of time.
Wait Overloaded. Waits for notification passed by the execution engine from the object (via the Pulse or PulseAll method). The Wait method must be invoked from within a synchronized block of code.

This method acquires the monitor waithandle for the object. If this thread holds the monitor lock for the object, it releases it. On exit from the method, it obtains the monitor lock back.

Protected:

Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by the Garbage Collector (GC). This method may be ignored by the runtime; therefore, necessary cleanup operations should be done elsewhere.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Monitor Class | System.Threading Namespace