1 import threading
2
4 """A counterpart of the C{time.sleep()} function. This implementation
5 allows some thread to wake up the sleeping thread.
6 """
8 self.__cond = threading.Condition()
9
10 - def sleep(self, seconds):
11 self.__cond.acquire()
12 self.__cond.wait(seconds)
13 self.__cond.release()
14
16 self.__cond.acquire()
17 self.__cond.notifyAll()
18 self.__cond.release()
19