fix locking

This commit is contained in:
Michael Davidsaver
2013-03-31 17:44:51 -04:00
parent 5a5fbddc27
commit 40714ca0fa

View File

@ -76,9 +76,11 @@ def _default_whendone(type, val, tb):
class IOScanListThread(IOScanListBlock):
_worker = None
_worker_lock = threading.Lock()
queuelength=100
@classmethod
def getworker(cls):
with cls._worker_lock:
if cls._worker:
return cls._worker
import hooks
@ -93,12 +95,10 @@ class IOScanListThread(IOScanListBlock):
self._lock = threading.Lock()
def add(self, rec):
print self,'add',rec
with self._lock:
return super(IOScanListThread,self).add(rec)
def _remove(self, rec):
print self,'remove',rec
with self._lock:
return super(IOScanListThread,self)._remove(rec)