Пример #1
0
        private void CreateMutexCore(bool initiallyOwned, string name, out bool createdNew)
        {
            Debug.Assert(name == null);

            SafeWaitHandle = WaitSubsystem.NewMutex(initiallyOwned);
            createdNew     = true;
        }
Пример #2
0
        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;
        }
Пример #3
0
        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;
        }
Пример #4
0
        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;
        }