GalleryLockSystem GalleryLockSystem(
)
|
|
array acquireReadLock(
mixed
$ids, [int
$timeout = 10]
)
|
|
Read lock one or more objects
Parameters:
mixed |
$ids: |
array of ids to lock, or single int id |
int |
$timeout: |
(optional) how many seconds to wait for the lock before giving up |
API Tags:
Return: | GalleryStatus a status code mixed the lock id |
Redefined in descendants as:
array acquireWriteLock(
mixed
$ids, [int
$timeout = 10]
)
|
|
Write lock one or more objects
Parameters:
mixed |
$ids: |
array of ids to lock, or single int id |
int |
$timeout: |
(optional) how many seconds to wait for the lock before giving up |
API Tags:
Return: | GalleryStatus a status code mixed the lock id |
Redefined in descendants as:
Return the ids of all the locks we hold
API Tags:
Redefined in descendants as:
boolean isReadLocked(
int
$id
)
|
|
Return true if the given id is read locked or write locked
Parameters:
API Tags:
Return: | true if the object is read locked |
Redefined in descendants as:
boolean isWriteLocked(
int
$id
)
|
|
Return true if the given id is write locked
Parameters:
API Tags:
Return: | true if the object is write locked |
Redefined in descendants as:
Refresh all the locks that we hold so that they aren't accidentally considered expired
Parameters:
int |
$freshUntil: |
the new "fresh until" timestamp |
API Tags:
Return: | a status code |
Abstract: | |
Redefined in descendants as:
Release any locks that we're holding
API Tags:
Redefined in descendants as:
Release the given lock(s) (queue the specified locks for later release on transactional databases or release them immediately if transactions are not supported)
Parameters:
mixed |
$lockIds: |
array of lock ids, or a single lock id |
API Tags:
Redefined in descendants as:
Cleanup any locks queued for release
API Tags:
array _acquireLock(
array
$ids, int
$timeout, int
$lockType
)
|
|
Extending class must implement this function to actually acquire a lock.
Parameters:
array |
$ids: |
of object ids |
int |
$timeout: |
how many seconds to wait for the lock before giving up |
int |
$lockType: |
LOCK_READ or LOCK_WRITE |
API Tags:
Return: | GalleryStatus a status code int the lock id |
Abstract: | |
Access: | protected |
Redefined in descendants as:
GalleryStatus _moveObjectsBetweenLocks(
array
$relock, int
$newLockId
)
|
|
Move ids from givens locks into a new lock.
Remove any locks that now have no objects remaining.
Parameters:
array |
$relock: |
of (lockId => array of ids) |
int |
$newLockId: |
move ids into this lock |
API Tags:
Return: | a status code |
Access: | protected |
Redefined in descendants as:
Generate an id for a new lock.
API Tags:
Return: | GalleryStatus a status code mixed lockId |
Abstract: | |
Access: | protected |
Redefined in descendants as:
Release the given locks now
Parameters:
array |
$locks: |
of lockId => lock |
API Tags:
Return: | a status code |
Abstract: | |
Access: | protected |
Redefined in descendants as:
GalleryStatus _removeObjectsFromLock(
&$lock, array
$ids, array
$lock
)
|
|
Remove some object ids from the given lock.
Parameters:
array |
$lock: |
|
array |
$ids: |
ids to remove |
|
&$lock: |
|
API Tags:
Return: | a status code |
Abstract: | |
Access: | protected |
Redefined in descendants as: