Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- class ThreadingExt:
- data = threading.local()
- @staticmethod
- def createStopEvent(event):
- ThreadingExt.data.stopevent = event
- @staticmethod
- def sleep(period_sec):
- ThreadingExt.data.stopevent.wait(period_sec)
- @staticmethod
- def isThreadStopped():
- return ThreadingExt.data.stopevent.isSet()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement