From: dman <ds...@ri...> - 2002-01-09 20:28:58
|
On Wed, Jan 09, 2002 at 11:51:06AM -0800, R Datta wrote: | I am working on a jython script that starts multiple threads. The threads | report statistics (like how many transactions per second) to the monitor | thread, ie, each thread would need to lock the statistics variable, update | it and then release the lock. | | Could someone send me some sample code that illustrates how to lock a | variable in jython? import threading lock = threading.Lock() # the lock variable = 1 # the variable # somewhere else lock.acquire() varaible = 2 lock.release() -D -- Be sure of this: The wicked will not go unpunished, but those who are righteous will go free. Proverbs 11:21 |