En Sun, 28 Dec 2008 12:10:06 -0200, aspineux <aspin...@gmail.com> escribió:
I got this.
This is a test script, to help me to understand why I have unexpected
result in application.
But I got a more unexpected result, and probably wrong error message
about the read-only cursor.
def server():
dbenv, db=init_db(read_only=False)
update_thread=threading.Thread(target=lambda : cleanup(db))
update_thread.setDaemon(True)
update_thread.start()
I'd write it as
update_thread = threading.Thread(target=cleanup, args=(db,))
or:
update_thread = threading.Thread(target=lambda db=db: cleanup(db))
The original code is creating a closure and I'm unsure how closures
interact with threads.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list