public static int ReleaseSemaphore(WaitableObject waitableObject, int count) { Debug.Assert(waitableObject != null); Debug.Assert(count > 0); s_lock.Acquire(); try { return(waitableObject.SignalSemaphore(count)); } finally { s_lock.Release(); } }
public static int ReleaseSemaphore(WaitableObject waitableObject, int count) { Debug.Assert(waitableObject != null); Debug.Assert(count > 0); LockHolder lockHolder = new LockHolder(s_lock); try { return(waitableObject.SignalSemaphore(count, ref lockHolder)); } finally { lockHolder.Dispose(); } }
public static int ReleaseSemaphore(IntPtr handle, int count) { Debug.Assert(count > 0); WaitableObject waitableObject = HandleManager.FromHandle(handle); s_lock.Acquire(); try { return(waitableObject.SignalSemaphore(count)); } finally { s_lock.Release(); } }