Esempio n. 1
0
    def __init__(self, filename):

        self.filename = filename
        self.lockfilename = filename + '.locked'
        self.locked = 0
        # Avoid deadlocks
        ExitFunctions.register(self.unlock)
Esempio n. 2
0
    def __init__(self, filename):

        self.filename = filename
        self.lockfilename = filename + '.locked'
        self.locked = 0
        # Avoid deadlocks
        ExitFunctions.register(self.unlock)
Esempio n. 3
0
    def __del__(self):

        if self.locked:
            self.unlock(0)
        try:
            ExitFunctions.deregister(self.unlock)
        except:
            pass
Esempio n. 4
0
    def __del__(self):

        if self.locked:
            self.unlock(0)
        try:
            ExitFunctions.deregister(self.unlock)
        except:
            pass