Пример #1
0
        def testD(self):
            lock = Lock()
            lock.acquire()
            lock.release()

            fut = lock.acquire()
            assert fut.done()
Пример #2
0
        def testE(self):
            lock = Lock()
            lock.acquire()

            f1 = lock.acquire()
            assert not f1.done()
            lock.release()

            f2 = lock.acquire()
            assert not f2.done()

            lock.release()
            assert f1.done()

            lock.release()
            assert f2.done()
Пример #3
0
        def testSecondAcquireBlocks(self):
            lock = Lock()
            lock.acquire()

            fut = lock.acquire()
            assert not fut.done()
Пример #4
0
        def testFirstAcquirePasses(self):
            lock = Lock()

            fut = lock.acquire()
            assert fut.done()