diff options
author | aleherbau | 2011-05-31 13:20:47 +0000 |
---|---|---|
committer | aleherbau | 2011-05-31 13:20:47 +0000 |
commit | 6c66f7e4848a076f553c81bdb64dd85610af2d79 (patch) | |
tree | 23a07788884e728dbc5b7ad3e6eaef417a0837e4 /python/src/tcf/EventQueue.py | |
parent | 0e77355b3f6d073cbf77d596308a5a679e7c6f13 (diff) | |
download | org.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.tar.gz org.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.tar.xz org.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.zip |
TCF Python: Start discovery on demand only
Diffstat (limited to 'python/src/tcf/EventQueue.py')
-rw-r--r-- | python/src/tcf/EventQueue.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/src/tcf/EventQueue.py b/python/src/tcf/EventQueue.py index c3084dde2..0efc5f60c 100644 --- a/python/src/tcf/EventQueue.py +++ b/python/src/tcf/EventQueue.py @@ -14,11 +14,12 @@ import protocol class EventQueue(object):
- def __init__(self):
+ def __init__(self, on_shutdown=None):
self.__thread = threading.Thread(target=self, name="TCF Event Dispatcher")
self.__thread.daemon = True
self.__is_waiting = False
self.__is_shutdown = False
+ self.__on_shutdown = on_shutdown
self.__lock = threading.Condition()
self.__queue = []
@@ -27,6 +28,8 @@ class EventQueue(object): def shutdown(self):
try:
+ if self.__on_shutdown:
+ self.__on_shutdown()
with self.__lock:
self.__is_shutdown = True
if self.__is_waiting:
|