aboutsummaryrefslogtreecommitdiff
path: root/operationscore/SmootCoreObject.py
diff options
context:
space:
mode:
Diffstat (limited to 'operationscore/SmootCoreObject.py')
-rw-r--r--operationscore/SmootCoreObject.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py
index d29e710..8514b3e 100644
--- a/operationscore/SmootCoreObject.py
+++ b/operationscore/SmootCoreObject.py
@@ -1,16 +1,24 @@
import Util
import pdb
-class SmootCoreObject:
- def __init__(self, argDict):
+import threading
+import thread
+class SmootCoreObject(threading.Thread):
+ def __init__(self, argDict, skipValidation = False):
self.argDict = argDict
self.validateArgs(self.className()+'.params')
+ self.lock = thread.allocate_lock()
self.init() #call init of inheriting class
# self.__setitem__ = self.argDict.__setitem__
# self.__getitem__ = self.argDict.__getitem__
def init(self):
pass
+ def acquireLock(self):
+ self.lock = thread.allocate_lock() #TODO: fix.
+ self.lock.acquire()
+ def releaseLock(self):
+ self.lock.release()
def className(self):
- return str(self.__class__).split('.')[-1]
+ return str(self.__class__).split('.')[-1] #TODO: this doesn't work.
def __setitem__(self,k, item):
self.argDict[k] = item
def __getitem__(self, item):