class_docstr: A simple reader-writer lock Several readers can hold the lock
  simultaneously, XOR one writer. Write locks have priority over reads to
  prevent write starvation.
class_docstr_tok: ["A","simple","reader-writer","lock","Several","readers","can","hold","the","lock","simultaneously",",","XOR","one","writer",".","Write","locks","have","priority","over","reads","to","prevent","write","starvation","."]
docstr: Acquire a write lock. Only one thread can hold this lock, and
  only when no read locks are also held.
docstr_tok: ["Acquire","a","write","lock",".","Only","one","thread","can","hold","this","lock",",","and","only","when","no","read","locks","are","also","held","."]
code: def acquire_write(self):
      """
      Acquire a write lock. Only one thread can hold this lock, and
      only when no read locks are also held.
      """
      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()
  
imports: import threading
label_desc: Use image node_id 3 for calling the RWLock obj's underlying member method code with example usage: obj.acquire_write() without return types