constrictor shared thread lock
authorBill Erickson <berick@esilibrary.com>
Tue, 7 May 2013 20:29:26 +0000 (16:29 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 7 May 2013 20:29:26 +0000 (16:29 -0400)
Each script has a thread lock (RLock()) object which can be shared by
its threads to manage all its thread locking needs.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
constrictor/script.py

index c690d94..5ba2cbc 100644 (file)
@@ -25,6 +25,7 @@ from log import *
 class Script(object):
     def __init__(self, name=''):
         self.name = name
+        self.lock = threading.RLock()
     def run(self):
         log_error('Override Script.run() to run a script!')
         sys.exit(1)