System.Net.UnsafeNclNativeMethods.ReleaseSemaphore C# (CSharp) Method

ReleaseSemaphore() private method

private ReleaseSemaphore ( [ hSemaphore, [ lReleaseCount, [ lpPreviousCount ) : bool
hSemaphore [
lReleaseCount [
lpPreviousCount [
return bool
        internal static extern bool ReleaseSemaphore([In] IntPtr hSemaphore, [In] int lReleaseCount, [Out] out int lpPreviousCount);

Usage Example

        /*
         * //
         * public Semaphore(int initialCount, int maxCount, string name) : base() {
         *  lock (this) {
         *      //
         *      Handle = UnsafeNclNativeMethods.CreateSemaphore(IntPtr.Zero, initialCount, maxCount, name);
         *  }
         * }
         */

        internal bool ReleaseSemaphore()
        {
#if DEBUG
            int  previousCount;
            bool success = UnsafeNclNativeMethods.ReleaseSemaphore(Handle, 1, out previousCount);
            GlobalLog.Print("ReleaseSemaphore#" + ValidationHelper.HashString(this) + " success:" + success + " previousCount:" + previousCount.ToString());
            return(success);
#else
            return(UnsafeNclNativeMethods.ReleaseSemaphore(Handle, 1, IntPtr.Zero));
#endif
        }
All Usage Examples Of System.Net.UnsafeNclNativeMethods::ReleaseSemaphore