Package gofer :: Package agent :: Module lock :: Class Lock
[hide private]
[frames] | no frames]

Class Lock

source code

File backed Reentrant lock.

Instance Methods [hide private]
 
__init__(self, path) source code
Lock
acquire(self, blocking=1)
Acquire the lock.
source code
 
release(self)
Release the lock.
source code
 
setpid(self, pid)
Write our procecss id and flush.
source code
int
__push(self)
Increment the lock depth.
source code
int
__pop(self)
Decrement the lock depth.
source code
 
__lock(self, blocking=1) source code
 
__unlock(self) source code
Method Details [hide private]

acquire(self, blocking=1)

source code 

Acquire the lock. Acquire the mutex; acquire the lockfile.

Parameters:
  • blocking (bool) - Wait for the lock.
Returns: Lock
self

release(self)

source code 

Release the lock. Release the lockfile; release the mutex.

setpid(self, pid)

source code 

Write our procecss id and flush.

Parameters:
  • pid (int) - The process ID.

__push(self)

source code 

Increment the lock depth.

Returns: int
The incremented depth

__pop(self)

source code 

Decrement the lock depth.

Returns: int
The decremented depth