public int Release(int releaseCount)
{
if (releaseCount < 1)
{
throw new ArgumentOutOfRangeException("releaseCount", SR.GetString(SR.ArgumentOutOfRange_NeedNonNegNumRequired));
}
int previousCount;
//If ReleaseSempahore returns false when the specified value would cause
// the semaphore's count to exceed the maximum count set when Semaphore was created
//Non-Zero return
if (!SafeNativeMethods.ReleaseSemaphore(SafeWaitHandle, releaseCount, out previousCount))
{
throw new SemaphoreFullException();
}
return previousCount;
}