t.p.l.FilesystemLock : class documentation

Part of twisted.python.lockfile View Source View In Hierarchy

Known subclasses: twisted.internet.defer.DeferredFilesystemLock

A mutex.

This relies on the filesystem property that creating a symlink is an atomic operation and that it will fail if the symlink already exists. Deleting the symlink will release the lock.
Instance VariablesnameThe name of the file associated with this lock.
cleanIndicates whether this lock was released cleanly by its last owner. Only meaningful after lock has been called and returns True.
Method __init__ Undocumented
Method lock Acquire this lock.
Method unlock Release this lock.
def __init__(self, name): (source)
Undocumented
def lock(self): (source)
Acquire this lock.
ReturnsTrue if the lock is acquired, false otherwise. (type: bool )
RaisesAny exception os.symlink() may raise, other than EEXIST.
def unlock(self): (source)

Release this lock.

This deletes the directory with the given name.
RaisesAny exception os.readlink() may raise, or ValueError if the lock is not owned by this process.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.