Exemple #1
0
        public static void SetAccessControl(this Semaphore semaphore, SemaphoreSecurity semaphoreSecurity)
        {
            if (semaphoreSecurity == null)
            {
                throw new ArgumentNullException(nameof(semaphoreSecurity));
            }

            semaphoreSecurity.Persist(semaphore.GetSafeWaitHandle());
        }
Exemple #2
0
 public static SemaphoreSecurity GetAccessControl(this Semaphore semaphore)
 {
     return(new SemaphoreSecurity(semaphore.GetSafeWaitHandle(), AccessControlSections.Access | AccessControlSections.Owner | AccessControlSections.Group));
 }
Exemple #3
0
        public static void SetAccessControl(this Semaphore semaphore, SemaphoreSecurity semaphoreSecurity)
        {
            ArgumentNullException.ThrowIfNull(semaphoreSecurity);

            semaphoreSecurity.Persist(semaphore.GetSafeWaitHandle());
        }