Promote an already acquired read lock to a write lock
        notice: this function can easily cause a deadlock!!!!!!!!!

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