public void EndRead()
 {
     Monitor.Enter(this);
     readerCount--;
     Monitor.PulseAll(this);
     Monitor.Exit(this);
 }
        public void EndWrite()
        {
            Monitor.Enter(this);
            writerCount--;
#if DEBUG_THREADS
            writeLockHolder = null;
#endif
            Monitor.PulseAll(this);
            Monitor.Exit(this);
        }