public void ExitWriteLock()
{
EnterMyLock();
if (owners != -1)
{
ExitMyLock();
throw new SynchronizationLockException("Calling ExitWriterLock when no write lock is held");
}
write_thread = upgradable_thread = null;
owners = 0;
ExitAndWakeUpAppropriateWaiters();
}