def promote(self):
with self.mutex:<EOL><INDENT>self.rwlock -= <NUM_LIT:1><EOL>while self.rwlock != <NUM_LIT:0>:<EOL><INDENT>self._writer_wait()<EOL><DEDENT>self.rwlock = -<NUM_LIT:1><EOL><DEDENT>
Promote an already acquired read lock to a write lock
notice: this function can easily cause a deadlock!!!!!!!!!