mscorlib(4.0.0.0) API with additions
|
A synchronization primitive that can also be used for interprocess synchronization. More...
Public Member Functions | |
Mutex (bool initiallyOwned, string name, out bool createdNew) | |
Initializes a new instance of the T:System.Threading.Mutex class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, a string that is the name of the mutex, and a Boolean value that, when the method returns, indicates whether the calling thread was granted initial ownership of the mutex. More... | |
unsafe | Mutex (bool initiallyOwned, string name, out bool createdNew, MutexSecurity mutexSecurity) |
Initializes a new instance of the T:System.Threading.Mutex class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, a string that is the name of the mutex, a Boolean variable that, when the method returns, indicates whether the calling thread was granted initial ownership of the mutex, and the access control security to be applied to the named mutex. More... | |
Mutex (bool initiallyOwned, string name) | |
Initializes a new instance of the T:System.Threading.Mutex 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. More... | |
Mutex (bool initiallyOwned) | |
Initializes a new instance of the T:System.Threading.Mutex class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex. More... | |
Mutex () | |
Initializes a new instance of the T:System.Threading.Mutex class with default properties. More... | |
void | ReleaseMutex () |
Releases the T:System.Threading.Mutex once. More... | |
MutexSecurity | GetAccessControl () |
Gets a T:System.Security.AccessControl.MutexSecurity object that represents the access control security for the named mutex. More... | |
void | SetAccessControl (MutexSecurity mutexSecurity) |
Sets the access control security for a named system mutex. More... | |
![]() | |
virtual bool | WaitOne (int millisecondsTimeout, bool exitContext) |
Blocks the current thread until the current T:System.Threading.WaitHandle receives a signal, using a 32-bit signed integer to specify the time interval and specifying whether to exit the synchronization domain before the wait. More... | |
virtual bool | WaitOne (TimeSpan timeout, bool exitContext) |
Blocks the current thread until the current instance receives a signal, using a T:System.TimeSpan to specify the time interval and specifying whether to exit the synchronization domain before the wait. More... | |
virtual bool | WaitOne () |
Blocks the current thread until the current T:System.Threading.WaitHandle receives a signal. More... | |
virtual bool | WaitOne (int millisecondsTimeout) |
Blocks the current thread until the current T:System.Threading.WaitHandle receives a signal, using a 32-bit signed integer to specify the time interval in milliseconds. More... | |
virtual bool | WaitOne (TimeSpan timeout) |
Blocks the current thread until the current instance receives a signal, using a T:System.TimeSpan to specify the time interval. More... | |
virtual void | Close () |
Releases all resources held by the current T:System.Threading.WaitHandle. More... | |
void | Dispose () |
Releases all resources used by the current instance of the T:System.Threading.WaitHandle class. More... | |
![]() | |
object | GetLifetimeService () |
Retrieves the current lifetime service object that controls the lifetime policy for this instance. More... | |
virtual object | InitializeLifetimeService () |
Obtains a lifetime service object to control the lifetime policy for this instance. More... | |
virtual ObjRef | CreateObjRef (Type requestedType) |
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. More... | |
Static Public Member Functions | |
static Mutex | OpenExisting (string name) |
Opens the specified named mutex, if it already exists. More... | |
static Mutex | OpenExisting (string name, MutexRights rights) |
Opens the specified named mutex, if it already exists, with the desired security access. More... | |
static bool | TryOpenExisting (string name, out Mutex result) |
Opens the specified named mutex, if it already exists, and returns a value that indicates whether the operation succeeded. More... | |
static bool | TryOpenExisting (string name, MutexRights rights, out Mutex result) |
Opens the specified named mutex, if it already exists, with the desired security access, and returns a value that indicates whether the operation succeeded. More... | |
![]() | |
static bool | WaitAll (WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) |
Waits for all the elements in the specified array to receive a signal, using an T:System.Int32 value to specify the time interval and specifying whether to exit the synchronization domain before the wait. More... | |
static bool | WaitAll (WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) |
Waits for all the elements in the specified array to receive a signal, using a T:System.TimeSpan value to specify the time interval, and specifying whether to exit the synchronization domain before the wait. More... | |
static bool | WaitAll (WaitHandle[] waitHandles) |
Waits for all the elements in the specified array to receive a signal. More... | |
static bool | WaitAll (WaitHandle[] waitHandles, int millisecondsTimeout) |
Waits for all the elements in the specified array to receive a signal, using an T:System.Int32 value to specify the time interval. More... | |
static bool | WaitAll (WaitHandle[] waitHandles, TimeSpan timeout) |
Waits for all the elements in the specified array to receive a signal, using a T:System.TimeSpan value to specify the time interval. More... | |
static int | WaitAny (WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) |
Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval, and specifying whether to exit the synchronization domain before the wait. More... | |
static int | WaitAny (WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) |
Waits for any of the elements in the specified array to receive a signal, using a T:System.TimeSpan to specify the time interval and specifying whether to exit the synchronization domain before the wait. More... | |
static int | WaitAny (WaitHandle[] waitHandles, TimeSpan timeout) |
Waits for any of the elements in the specified array to receive a signal, using a T:System.TimeSpan to specify the time interval. More... | |
static int | WaitAny (WaitHandle[] waitHandles) |
Waits for any of the elements in the specified array to receive a signal. More... | |
static int | WaitAny (WaitHandle[] waitHandles, int millisecondsTimeout) |
Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval. More... | |
static bool | SignalAndWait (WaitHandle toSignal, WaitHandle toWaitOn) |
Signals one T:System.Threading.WaitHandle and waits on another. More... | |
static bool | SignalAndWait (WaitHandle toSignal, WaitHandle toWaitOn, TimeSpan timeout, bool exitContext) |
Signals one T:System.Threading.WaitHandle and waits on another, specifying the time-out interval as a T:System.TimeSpan and specifying whether to exit the synchronization domain for the context before entering the wait. More... | |
static bool | SignalAndWait (WaitHandle toSignal, WaitHandle toWaitOn, int millisecondsTimeout, bool exitContext) |
Signals one T:System.Threading.WaitHandle and waits on another, specifying a time-out interval as a 32-bit signed integer and specifying whether to exit the synchronization domain for the context before entering the wait. More... | |
Additional Inherited Members | |
![]() | |
const int | WaitTimeout = 258 |
Indicates that a M:System.Threading.WaitHandle.WaitAny(System.Threading.WaitHandle[],System.Int32,System.Boolean) operation timed out before any of the wait handles were signaled. This field is constant. More... | |
![]() | |
WaitHandle () | |
Initializes a new instance of the T:System.Threading.WaitHandle class. More... | |
virtual void | Dispose (bool explicitDisposing) |
When overridden in a derived class, releases the unmanaged resources used by the T:System.Threading.WaitHandle, and optionally releases the managed resources. More... | |
![]() | |
MarshalByRefObject | MemberwiseClone (bool cloneIdentity) |
Creates a shallow copy of the current T:System.MarshalByRefObject object. More... | |
![]() | |
static readonly IntPtr | InvalidHandle = GetInvalidHandle() |
Represents an invalid native operating system handle. This field is read-only. More... | |
![]() | |
virtual IntPtr | Handle [get, set] |
Gets or sets the native operating system handle. More... | |
SafeWaitHandle | SafeWaitHandle [get, set] |
Gets or sets the native operating system handle. More... | |
A synchronization primitive that can also be used for interprocess synchronization.
System.Threading.Mutex.Mutex | ( | bool | initiallyOwned, |
string | name, | ||
out bool | createdNew | ||
) |
Initializes a new instance of the T:System.Threading.Mutex class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, a string that is the name of the mutex, and a Boolean value that, when the method returns, indicates whether the calling thread was granted initial ownership of the mutex.
initiallyOwned | 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 . |
name | The name of the T:System.Threading.Mutex. If the value is null , the T:System.Threading.Mutex is unnamed. |
createdNew | When this method returns, contains a Boolean that is true if a local mutex was created (that is, if name is null or an empty string) or if the specified named system mutex was created; false if the specified named system mutex already existed. This parameter is passed uninitialized. |
T:System.UnauthorizedAccessException | The named mutex exists and has access control security, but the user does not have F:System.Security.AccessControl.MutexRights.FullControl. |
T:System.IO.IOException | A Win32 error occurred. |
T:System.Threading.WaitHandleCannotBeOpenedException | The named mutex cannot be created, perhaps because a wait handle of a different type has the same name. |
T:System.ArgumentException | name is longer than 260 characters. |
unsafe System.Threading.Mutex.Mutex | ( | bool | initiallyOwned, |
string | name, | ||
out bool | createdNew, | ||
MutexSecurity | mutexSecurity | ||
) |
Initializes a new instance of the T:System.Threading.Mutex class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, a string that is the name of the mutex, a Boolean variable that, when the method returns, indicates whether the calling thread was granted initial ownership of the mutex, and the access control security to be applied to the named mutex.
initiallyOwned | 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 . |
name | The name of the system mutex. If the value is null , the T:System.Threading.Mutex is unnamed. |
createdNew | When this method returns, contains a Boolean that is true if a local mutex was created (that is, if name is null or an empty string) or if the specified named system mutex was created; false if the specified named system mutex already existed. This parameter is passed uninitialized. |
mutexSecurity | A T:System.Security.AccessControl.MutexSecurity object that represents the access control security to be applied to the named system mutex. |
T:System.IO.IOException | A Win32 error occurred. |
T:System.UnauthorizedAccessException | The named mutex exists and has access control security, but the user does not have F:System.Security.AccessControl.MutexRights.FullControl. |
T:System.Threading.WaitHandleCannotBeOpenedException | The named mutex cannot be created, perhaps because a wait handle of a different type has the same name. |
T:System.ArgumentException | name is longer than 260 characters. |
System.Threading.Mutex.Mutex | ( | bool | initiallyOwned, |
string | name | ||
) |
Initializes a new instance of the T:System.Threading.Mutex 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.
initiallyOwned | 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 . |
name | The name of the T:System.Threading.Mutex. If the value is null , the T:System.Threading.Mutex is unnamed. |
T:System.UnauthorizedAccessException | The named mutex exists and has access control security, but the user does not have F:System.Security.AccessControl.MutexRights.FullControl. |
T:System.IO.IOException | A Win32 error occurred. |
T:System.Threading.WaitHandleCannotBeOpenedException | The named mutex cannot be created, perhaps because a wait handle of a different type has the same name. |
T:System.ArgumentException | name is longer than 260 characters. |
System.Threading.Mutex.Mutex | ( | bool | initiallyOwned | ) |
Initializes a new instance of the T:System.Threading.Mutex class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex.
initiallyOwned | true to give the calling thread initial ownership of the mutex; otherwise, false . |
System.Threading.Mutex.Mutex | ( | ) |
MutexSecurity System.Threading.Mutex.GetAccessControl | ( | ) |
Gets a T:System.Security.AccessControl.MutexSecurity object that represents the access control security for the named mutex.
T:System.UnauthorizedAccessException | The current T:System.Threading.Mutex object represents a named system mutex, but the user does not have F:System.Security.AccessControl.MutexRights.ReadPermissions.-or-The current T:System.Threading.Mutex object represents a named system mutex, and was not opened with F:System.Security.AccessControl.MutexRights.ReadPermissions. |
T:System.NotSupportedException | Not supported for Windows 98 or Windows Millennium Edition. |
|
static |
Opens the specified named mutex, if it already exists.
name | The name of the system mutex to open. |
T:System.ArgumentException | name is an empty string.-or- name is longer than 260 characters. |
T:System.ArgumentNullException | name is null . |
T:System.Threading.WaitHandleCannotBeOpenedException | The named mutex does not exist. |
T:System.IO.IOException | A Win32 error occurred. |
T:System.UnauthorizedAccessException | The named mutex exists, but the user does not have the security access required to use it. |
|
static |
Opens the specified named mutex, if it already exists, with the desired security access.
name | The name of the system mutex to open. |
rights | A bitwise combination of the enumeration values that represent the desired security access. |
T:System.ArgumentException | name is an empty string. -or- name is longer than 260 characters. |
T:System.ArgumentNullException | name is null . |
T:System.Threading.WaitHandleCannotBeOpenedException | The named mutex does not exist. |
T:System.IO.IOException | A Win32 error occurred. |
T:System.UnauthorizedAccessException | The named mutex exists, but the user does not have the desired security access. |
void System.Threading.Mutex.ReleaseMutex | ( | ) |
void System.Threading.Mutex.SetAccessControl | ( | MutexSecurity | mutexSecurity | ) |
Sets the access control security for a named system mutex.
mutexSecurity | A T:System.Security.AccessControl.MutexSecurity object that represents the access control security to be applied to the named system mutex. |
T:System.ArgumentNullException | mutexSecurity is null . |
T:System.UnauthorizedAccessException | The user does not have F:System.Security.AccessControl.MutexRights.ChangePermissions.-or-The mutex was not opened with F:System.Security.AccessControl.MutexRights.ChangePermissions. |
T:System.SystemException | The current T:System.Threading.Mutex object does not represent a named system mutex. |
|
static |
Opens the specified named mutex, if it already exists, and returns a value that indicates whether the operation succeeded.
name | The name of the system mutex to open. |
result | When this method returns, contains a T:System.Threading.Mutex object that represents the named mutex if the call succeeded, or null if the call failed. This parameter is treated as uninitialized. |
true
if the named mutex was opened successfully; otherwise, false
.T:System.ArgumentException | name is an empty string.-or- name is longer than 260 characters. |
T:System.ArgumentNullException | name is null . |
T:System.IO.IOException | A Win32 error occurred. |
T:System.UnauthorizedAccessException | The named mutex exists, but the user does not have the security access required to use it. |
|
static |
Opens the specified named mutex, if it already exists, with the desired security access, and returns a value that indicates whether the operation succeeded.
name | The name of the system mutex to open. |
rights | A bitwise combination of the enumeration values that represent the desired security access. |
result | When this method returns, contains a T:System.Threading.Mutex object that represents the named mutex if the call succeeded, or null if the call failed. This parameter is treated as uninitialized. |
true
if the named mutex was opened successfully; otherwise, false
.T:System.ArgumentException | name is an empty string.-or- name is longer than 260 characters. |
T:System.ArgumentNullException | name is null . |
T:System.IO.IOException | A Win32 error occurred. |
T:System.UnauthorizedAccessException | The named mutex exists, but the user does not have the security access required to use it. |