th = threading.Thread(target=objectsore.commit, name='updating database')
th.start()
That's it!
(And you can use threading.enumerate if you need a list of threads...)
On 3/28/06, Koen Bok <[EMAIL PROTECTED]> wrote:
Hi I would like to wrap a thread around objectstore.commit () I could not get it to work.What am I doing wrong?class Controller(Object):threads = []def commit_(self):t = CommitChanges(objectstore)self.threads.append(t)class CommitChanges(Thread):def __init__ (self, objectstore):Thread.__init__(self)self.description = "Updating Database"self.objectstore = objectstoreself.start()def run(self):self.objectstore.commit()
--
Jonathan Ellis
http://spyced.blogspot.com