runtime/Worker.py
changeset 2537 eb4a4cc41914
parent 2536 2747d6e72eb8
child 2604 c8a25a3a7f8b
--- a/runtime/Worker.py	Wed Mar 13 10:19:30 2019 +0300
+++ b/runtime/Worker.py	Wed Mar 13 11:47:03 2019 +0300
@@ -9,9 +9,9 @@
 
 from __future__ import absolute_import
 import sys
-import thread
 from threading import Lock, Condition
 import six
+from six.moves import _thread
 
 
 class job(object):
@@ -65,7 +65,7 @@
         """
         meant to be called by worker thread (blocking)
         """
-        self._threadID = thread.get_ident()
+        self._threadID = _thread.get_ident()
         self.mutex.acquire()
         if args or kwargs:
             _job = job(*args, **kwargs)
@@ -93,7 +93,7 @@
 
         _job = job(*args, **kwargs)
 
-        if self._threadID == thread.get_ident():
+        if self._threadID == _thread.get_ident():
             # if caller is worker thread execute immediately
             _job.do()
         else: