another thread on Python threading

sturlamolden sturlamolden at
Mon Jun 4 23:58:53 CEST 2007

On Jun 4, 10:11 pm, Josiah Carlson <josiah.carl... at>

>      lock = threading.Lock()
>      with lock:
>          #synchronized block!
>          pass

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.

More information about the Python-list mailing list