First time I have used thread locking. This seems to work but is it correct?
from threading import Thread, Event, Lock . . . def launch(self, ThreadTitle, SubToLaunch, SubsArgs=(), SubsKwargs={}, AsDaemon=True): my_lock = Lock() my_lock.acquire() try: # --------------------- t = Thread(target=SubToLaunch, args = SubsArgs, kwargs = SubsKwargs) t.setDaemon(AsDaemon) t.start() self.Threads[len(self.Threads)] = t # Stash the thread in an instance local # --------------------- ServerThreads.threadcount += 1 finally: my_lock.release() . . . -- http://mail.python.org/mailman/listinfo/python-list