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
|
|
|
_is_owned(self)
Is the current thread a current level owner? |
source code
|
|
|
_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,
test_notify=None)
Acquire a set of resource locks. |
source code
|
|
|
__acquire_inner(self,
names,
want_all,
shared,
priority,
timeout_fn,
test_notify)
Inner logic for acquiring a number of locks. |
source code
|
|
|
|
|
add(self,
names,
acquired=0,
shared=0)
Add a new set of elements to the set |
source code
|
|
|
|