How to implement a Mutex in Python when using Gtk with PyGTK
        Posted  
        
            by 
                Julian
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Julian
        
        
        
        Published on 2011-01-15T12:29:33Z
        Indexed on 
            2011/01/15
            12:53 UTC
        
        
        Read the original article
        Hit count: 287
        
Hi, I have an application that starts several threads using
gobject.timeout_add(delay, function)
Now in my function I want to test and set on some variable, e.g.
def function(self):
    if flag == True:
        flag = False
        doSomething()
Now to make this threadsafe, I would have to lock the function using some mutex lock.
Is this possible with Gtk? Or can I use the Python Lock objects from threading?
© Stack Overflow or respective owner