public void ExitWriteLock ()
{
EnterMyLock ();
if (owners != -1) {
ExitMyLock ();
throw new SynchronizationLockException ("Calling ExitWriterLock when no write lock is held");
}
//Debug.Assert (numUpgradeWaiters > 0);
if (upgradable_thread == Thread.CurrentThread)
owners = 1;
else
owners = 0;
write_thread = null;
ExitAndWakeUpAppropriateWaiters ();
}