def release(self):
        """Release the lock, allowing another thread that is blocked waiting for
           the lock to acquire the lock.  The lock must be in the locked state,
           but it needn't be locked by the same thread that unlocks it."""
        if self.locked == 0:
            raise Exception('this lock is not locked')
        PyThread_release_lock(self.lock)
        self.locked = 0
Release the lock, allowing another thread that is blocked waiting for
           the lock to acquire the lock.  The lock must be in the locked state,
           but it needn't be locked by the same thread that unlocks it.
recipes/Python/310792_native_implementatithreadingLock_threadingRLock_/recipe-310792.py