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

            SafeWaitHandle = WaitSubsystem.NewSemaphore(initialCount, maximumCount);
            createdNew     = true;
        }
Пример #2
0
        private void CreateSemaphoreCore(int initialCount, int maximumCount, string?name, out bool createdNew)
        {
            if (name != null)
            {
                throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
            }

            SafeWaitHandle = WaitSubsystem.NewSemaphore(initialCount, maximumCount);
            createdNew     = true;
        }