code: def acquire_writer(self):
          
          with self.mutex:
              while self.rwlock != 0:
                  self._writer_wait()
              self.rwlock = -1
docs: Acquire a write lock, only one thread can hold this lock
          and only when no read locks are also held.