Package buildbot :: Module locks :: Class BaseLock
[frames | no frames]

Class BaseLock

Known Subclasses:
RealMasterLock

Class handling claiming and releasing of self, and keeping track of current and waiting owners.

Note: Ideally, we'd like to maintain FIFO order. The place to do that would be the isAvailable() function. However, this function is called by builds/steps both for the first time, and after waking them up by self from the self.waiting queue. There is currently no way of distinguishing between them.

Method Summary
  __init__(self, name, maxCount)
  __repr__(self)
  claim(self, owner, access)
Claim the lock (lock must be available)
  isAvailable(self, access)
Return a boolean whether the lock is available for claiming
  release(self, owner, access)
Release the lock
  waitUntilMaybeAvailable(self, owner, access)
Fire when the lock *might* be available.

Class Variable Summary
str description = '<BaseLock>'

Method Details

claim(self, owner, access)

Claim the lock (lock must be available)

isAvailable(self, access)

Return a boolean whether the lock is available for claiming

release(self, owner, access)

Release the lock

waitUntilMaybeAvailable(self, owner, access)

Fire when the lock *might* be available. The caller will need to check with isAvailable() when the deferred fires. This loose form is used to avoid deadlocks. If we were interested in a stronger form, this would be named 'waitUntilAvailable', and the deferred would fire after the lock had been claimed.

Class Variable Details

description

Type:
str
Value:
'<BaseLock>'                                                           

Generated by Epydoc 2.1 on Tue Sep 16 09:15:59 2008 http://epydoc.sf.net