code: def acquire_write(self):
          
          self.monitor.acquire()
          while self.rwlock != 0:
              self.writers_waiting += 1
              self.writers_ok.wait()
              self.writers_waiting -= 1
          self.rwlock = -1
          self.monitor.release()
docs: Acquire a write lock. Only one thread can hold this lock, and
          only when no read locks are also held.