mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Threading.WaitHandle System.Runtime.InteropServices.ComVisible(true)

When two or more threads need to access a shared resource at the same time, the system needs a synchronization mechanism to ensure that only one thread at a time uses the resource. is a synchronization primitive that grants exclusive access to the shared resource to only one thread. If a thread acquires a mutex, the second thread that wants to acquire that mutex is suspended until the first thread releases the mutex.

You can use the method to request ownership of a mutex. The thread that owns a mutex can request the same mutex in repeated calls to without blocking its execution. However, the thread must call the method the same number of times to release ownership of the mutex. The class enforces thread identity, so a mutex can be released only by the thread that acquired it. By contrast, the class does not enforce thread identity.

If a thread terminates while owning a mutex, the mutex is said to be abandoned. The state of the mutex is set to signaled, and the next waiting thread gets ownership. Beginning in version 2.0 of the .NET Framework, an is thrown in the next thread that acquires the abandoned mutex. Before version 2.0 of the .NET Framework, no exception was thrown.

An abandoned mutex often indicates a serious error in the code. When a thread exits without releasing the mutex, the data structures protected by the mutex might not be in a consistent state. The next thread to request ownership of the mutex can handle this exception and proceed, if the integrity of the data structures can be verified.

In the case of a system-wide mutex, an abandoned mutex might indicate that an application has been terminated abruptly (for example, by using Windows Task Manager).

Mutexes are of two types: local mutexes, which are unnamed, and named system mutexes. A local mutex exists only within your process. It can be used by any thread in your process that has a reference to the object that represents the mutex. Each unnamed object represents a separate local mutex.

Named system mutexes are visible throughout the operating system, and can be used to synchronize the activities of processes. You can create a object that represents a named system mutex by using a constructor that accepts a name. The operating-system object can be created at the same time, or it can exist before the creation of the object. You can create multiple objects that represent the same named system mutex, and you can use the method to open an existing named system mutex.

On a server that is running Terminal Services, a named system mutex can have two levels of visibility. If its name begins with the prefix "Global\", the mutex is visible in all terminal server sessions. If its name begins with the prefix "Local\", the mutex is visible only in the terminal server session where it was created. In that case, a separate mutex with the same name can exist in each of the other terminal server sessions on the server. If you do not specify a prefix when you create a named mutex, it takes the prefix "Local\". Within a terminal server session, two mutexes whose names differ only by their prefixes are separate mutexes, and both are visible to all processes in the terminal server session. That is, the prefix names "Global\" and "Local\" describe the scope of the mutex name relative to terminal server sessions, not relative to processes.

A synchronization primitive that can also be used for interprocess synchronization.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)

  Calling this constructor overload is the same as calling the constructor overload and specifying false for initial ownership of the mutex. That is, the calling thread does not own the mutex.

  Initializes a new instance of the class with default properties.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
  To be added

  Initializes a new instance of the class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex.

  true to give the calling thread initial ownership of the mutex; otherwise, false.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)

  If is not null and is true, the calling thread owns the mutex only if the named system mutex was created as a result of this call. Since there is no mechanism for determining whether the named system mutex was created, it is better to specify false for when calling this constructor overload. You can use the constructor if you need to determine initial ownership.

  This constructor initializes a object that represents a named system mutex. You can create multiple objects that represent the same named system mutex.

  If the named mutex has already been created with access control security, and the caller does not have , an exception is thrown. To open an existing named mutex with only those permissions needed for synchronizing thread activities, see the method.

  If you specify null or an empty string for , a local mutex is created, as if you had called the constructor. In this case, is always true.

  Because they are system-wide, named mutexes can be used to coordinate resource use across process boundaries.

  On a server that is running Terminal Services, a named system mutex can have two levels of visibility. If its name begins with the prefix "Global\", the mutex is visible in all terminal server sessions. If its name begins with the prefix "Local\", the mutex is visible only in the terminal server session where it was created. In that case, a separate mutex with the same name can exist in each of the other terminal server sessions on the server. If you do not specify a prefix when you create a named mutex, it takes the prefix "Local\". Within a terminal server session, two mutexes whose names differ only by their prefixes are separate mutexes, and both are visible to all processes in the terminal server session. That is, the prefix names "Global\" and "Local\" describe the scope of the mutex name relative to terminal server sessions, not relative to processes.

  Initializes a new instance of the class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, and a string that is the name of the mutex.

  true to give the calling thread initial ownership of the named system mutex if the named system mutex is created as a result of this call; otherwise, false.
  The name of the . If the value is null, the is unnamed.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
  To be added: an object of type 'bool'
  To be added: an object of type 'string'
  To be added: an object of type 'bool&'
  To be added
  To be added
- Constructor
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Security.AccessControl.MutexSecurity

  The method uses the following combination of flags (combined using the bitwise OR operation) to search for permissions: , , and .

  The user must have to call this method, and the mutex must have been opened with .

  Gets a object that represents the access control security for the named mutex.

  A object that represents the access control security for the named mutex.

- Method
  2.0.0.0
  4.0.0.0
  System.Threading.Mutex ``

  The method tries to open the specified named system mutex. If the system mutex does not exist, this method throws an exception instead of creating the system object. To create the system mutex when it does not already exist, use one of the constructors that has a parameter.

  Multiple calls to this method that use the same value for do not necessarily return the same object, even though the objects that are returned represent the same named system mutex.

  This method overload is equivalent to calling the method overload and specifying and rights, combined by using the bitwise OR operation.

  Specifying the flag allows a thread to wait on the mutex, and specifying the flag allows a thread to call the method.

  This method does not request ownership of the mutex.

  Opens the specified named mutex, if it already exists.

  An object that represents the named system mutex.

  The name of the system mutex to open.
- Method
  2.0.0.0
  4.0.0.0
  System.Threading.Mutex `` ``

  The parameter must include the flag to allow threads to wait on the mutex, and the flag to allow threads to call the method.

  The method tries to open an existing named mutex. If the system mutex does not exist, this method throws an exception instead of creating the system object. To create the system mutex when it does not already exist, use one of the constructors that has a parameter.

  Multiple calls to this method that use the same value for do not necessarily return the same object, even though the objects that are returned represent the same named system mutex.

  This method does not request ownership of the mutex.

  Opens the specified named mutex, if it already exists, with the desired security access.

  An object that represents the named system mutex.

  The name of the system mutex to open. A bitwise combination of the enumeration values that represent the desired security access.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
  System.Void

  A thread that owns a mutex can specify the same mutex in repeated wait function calls without blocking its execution. The number of calls is kept by the common language runtime. The thread must call the same number of times to release ownership of the mutex.

  If a thread terminates while owning a mutex, the mutex is said to be abandoned. The state of the mutex is set to signaled and the next waiting thread gets ownership. If no one owns the mutex, the state of the mutex is signaled. Beginning in version 2.0 of the .NET Framework, an is thrown in the next thread that acquires the mutex. Prior to version 2.0 of the .NET Framework, no exception was thrown.

  An abandoned mutex often indicates a serious error in the code. When a thread exits without releasing the mutex, the data structures protected by the mutex might not be in a consistent state. The next thread to request ownership of the mutex can handle this exception and proceed, if the integrity of the data structures can be verified.

  In the case of a system-wide mutex, an abandoned mutex might indicate that an application has been terminated abruptly (for example, by using Windows Task Manager).

  Releases the once.

- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  The user must have rights to call this method, and the mutex must have been opened with .

  Sets the access control security for a named system mutex.

  A object that represents the access control security to be applied to the named system mutex.
- Method
  4.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Boolean `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.