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

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

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