another thread on Python threading
josiah.carlson at sbcglobal.net
Tue Jun 5 09:15:29 CEST 2007
> On Jun 4, 10:11 pm, Josiah Carlson <josiah.carl... at sbcglobal.net>
>> lock = threading.Lock()
>> with lock:
>> #synchronized block!
> True, except that the lock has to be shared among the threads. This
> explicit initiation of an reentrant lock is avoided in a Java
> synchronized block.
You toss the lock creation in the global namespace of the module for
which you would like to synchronize access.
More information about the Python-list