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