Implements a set of locks.
This abstraction implements a set of shared locks for the same
resource type, distinguished by name. The user can lock a subset of the
resources and the LockSet will take care of acquiring the locks always in
the same order, thus preventing deadlock.
All the locks needed in the same set must be acquired together,
though.
|
|
|
_GetLockName(self,
mname)
Returns the name for a member lock. |
source code
|
|
|
_get_lock(self)
Returns the lockset-internal lock. |
source code
|
|
|
|
|
|
bool
|
|
boolean
|
|
|
_add_owned(self,
name=None)
Note the current thread owns the given lock |
source code
|
|
|
_del_owned(self,
name=None)
Note the current thread owns the given lock |
source code
|
|
|
list_owned(self)
Get the set of resource names owned by the current thread |
source code
|
|
|
_release_and_delete_owned(self)
Release and delete all resources owned by the current thread |
source code
|
|
|
|
|
|
|
acquire(self,
names,
timeout=None,
shared=0,
priority=None,
opportunistic=False,
test_notify=None)
Acquire a set of resource locks. |
source code
|
|
|
__acquire_inner(self,
names,
mode,
shared,
priority,
timeout_fn,
test_notify)
Inner logic for acquiring a number of locks. |
source code
|
|
|
downgrade(self,
names=None)
Downgrade a set of resource locks from exclusive to shared mode. |
source code
|
|
|
|
|
add(self,
names,
acquired=0,
shared=0)
Add a new set of elements to the set |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|