Partial Function Application and implicit self problem

Gabriel Genellina gagsl-py2 at
Thu Mar 27 10:20:53 CET 2008

En Thu, 27 Mar 2008 05:40:30 -0300, Gabriel Rossetti  
<gabriel.rossetti at> escribió:

>>>          if(atomic):
>>>        # Lock the service dict and register the service, then unlock it
>>>        self.__mutex.lock(reg, service)
>>>        self.__mutex.unlock()

I see that you've already solved your original problem. But looking at  
those names, I wonder if you're using the mutex module; note that such  
"mutex" is absolutely useless in a multithreaded program, it doesn't  
guarantee mutual exclusion, the "atomic" testandset operation isn't atomic  
at all, by example.
For a "real" mutex, use a threading.Lock object.

Gabriel Genellina

More information about the Python-list mailing list