public static void SetAccessControl(this Semaphore semaphore, SemaphoreSecurity semaphoreSecurity) { if (semaphoreSecurity == null) { throw new ArgumentNullException(nameof(semaphoreSecurity)); } semaphoreSecurity.Persist(semaphore.GetSafeWaitHandle()); }
public static SemaphoreSecurity GetAccessControl(this Semaphore semaphore) { return(new SemaphoreSecurity(semaphore.GetSafeWaitHandle(), AccessControlSections.Access | AccessControlSections.Owner | AccessControlSections.Group)); }
public static void SetAccessControl(this Semaphore semaphore, SemaphoreSecurity semaphoreSecurity) { ArgumentNullException.ThrowIfNull(semaphoreSecurity); semaphoreSecurity.Persist(semaphore.GetSafeWaitHandle()); }