System.Security.AccessControl.SemaphoreSecurity.Persist C# (CSharp) Method

Persist() private method

private Persist ( SafeWaitHandle handle ) : void
handle Microsoft.Win32.SafeHandles.SafeWaitHandle
return void
        internal void Persist(SafeWaitHandle handle)
        {
            // Let the underlying ACL API's demand unmanaged code.

            WriteLock();

            try
            {
                AccessControlSections persistSections = GetAccessControlSectionsFromChanges();
                if (persistSections == AccessControlSections.None)
                    return;  // Don't need to persist anything.

                base.Persist(handle, persistSections);
                OwnerModified = GroupModified = AuditRulesModified = AccessRulesModified = false;
            }
            finally
            {
                WriteUnlock();
            }
        }

Usage Example

        public static void SetAccessControl(this Semaphore semaphore, SemaphoreSecurity semaphoreSecurity)
        {
            if (semaphoreSecurity == null)
                throw new ArgumentNullException("semaphoreSecurity");

            semaphoreSecurity.Persist(semaphore.GetSafeWaitHandle());
        }
All Usage Examples Of System.Security.AccessControl.SemaphoreSecurity::Persist