private void CreateMutexCore(bool initiallyOwned, string name, out bool createdNew) { Debug.Assert(name == null); SafeWaitHandle = WaitSubsystem.NewMutex(initiallyOwned); createdNew = true; }
private void CreateMutexCore(bool initiallyOwned, string name, out bool createdNew) { if (name != null) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); } SafeWaitHandle = WaitSubsystem.NewMutex(initiallyOwned); createdNew = true; }
private void CreateMutexCore(bool initiallyOwned, string?name, out bool createdNew) { // See https://github.com/dotnet/runtime/issues/48720 if (name != null) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); } SafeWaitHandle = WaitSubsystem.NewMutex(initiallyOwned); createdNew = true; }
private void CreateMutexCore(bool initiallyOwned, string?name, out bool createdNew) { if (name != null) { SafeWaitHandle?safeWaitHandle = WaitSubsystem.CreateNamedMutex(initiallyOwned, name, out createdNew); if (safeWaitHandle == null) { throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); } SafeWaitHandle = safeWaitHandle; return; } SafeWaitHandle = WaitSubsystem.NewMutex(initiallyOwned); createdNew = true; }