def test_reentrant_read(self): testLock = RWLock() testLock.reader_acquire() testLock.reader_acquire() testLock.reader_release() testLock.reader_release()
def __init_variables(): buffer_ = [] rw_lock = RWLock() threads = [] return (buffer_, rw_lock, threads)
def test_non_reentrant_write(self): testLock = RWLock() testLock.writer_acquire() self.assertRaises(RuntimeError, testLock.writer_acquire, blocking=False) testLock.writer_release()
def test_overrelease_write(self): testLock = RWLock() testLock.writer_acquire() testLock.writer_release() self.assertRaises(RuntimeError, testLock.writer_release)