phpDocumentor GalleryCore
Classes
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: FlockLockSystem

Source Location: /modules/core/classes/FlockLockSystem.class

Class FlockLockSystem

Class Overview

Flock() based locking. This is fairly efficient, but it will not work on NFS and is known to be unreliable on some operating systems including some flavors of the 2.4 Linux kernel.

Located in /modules/core/classes/FlockLockSystem.class [line 38]

GalleryLockSystem
   |
   --FlockLockSystem

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From GalleryLockSystem

GalleryLockSystem::$_locks
GalleryLockSystem::$_releaseQueue

Inherited From GalleryLockSystem

GalleryLockSystem::GalleryLockSystem()
GalleryLockSystem::acquireReadLock()
Read lock one or more objects
GalleryLockSystem::acquireWriteLock()
Write lock one or more objects
GalleryLockSystem::getLockIds()
Return the ids of all the locks we hold
GalleryLockSystem::isReadLocked()
Return true if the given id is read locked or write locked
GalleryLockSystem::isWriteLocked()
Return true if the given id is write locked
GalleryLockSystem::refreshLocks()
Refresh all the locks that we hold so that they aren't accidentally considered expired
GalleryLockSystem::releaseAllLocks()
Release any locks that we're holding
GalleryLockSystem::releaseLocks()
Release the given lock(s) (queue the specified locks for later release on transactional databases or release them immediately if transactions are not supported)
GalleryLockSystem::releaseQueue()
Cleanup any locks queued for release
GalleryLockSystem::_acquireLock()
Extending class must implement this function to actually acquire a lock.
GalleryLockSystem::_moveObjectsBetweenLocks()
Move ids from givens locks into a new lock.
GalleryLockSystem::_newLockId()
Generate an id for a new lock.
GalleryLockSystem::_releaseLocksNow()
Release the given locks now
GalleryLockSystem::_removeObjectsFromLock()
Remove some object ids from the given lock.

[ Top ]
Property Summary
array   $_references   Reference counts for every lock we're holding so that if we've got a file doubly read locked we don't try to delete it until all read locks are released.

[ Top ]
Method Summary
void   refreshLocks()  
void   _acquireLock()  
void   _closeLockFile()   Close file for this lock and remove file if there are no more references.
string   _getLockFile()   Return the lock file for a given object id.
void   _newLockId()  
void   _releaseLocksNow()  
void   _removeObjectsFromLock()  

[ Top ]
Properties
array   $_references [line 47]

Reference counts for every lock we're holding so that if we've got a file doubly read locked we don't try to delete it until all read locks are released.

API Tags:
Access:  private

Information Tags:
Todo:  When we get rid of double read locks, we can delete this.

[ Top ]
Methods
refreshLocks  [line 151]

  void refreshLocks( $freshUntil  )

Parameters:
   $freshUntil: 

API Tags:
See:  GalleryLockSystem::refreshLocks


Redefinition of:
GalleryLockSystem::refreshLocks()
Refresh all the locks that we hold so that they aren't accidentally considered expired

[ Top ]
_acquireLock  [line 52]

  void _acquireLock( $ids, $timeout, $lockType  )

Parameters:
   $ids: 
   $timeout: 
   $lockType: 

API Tags:
See:  GalleryLockSystem::_acquireLock


Redefinition of:
GalleryLockSystem::_acquireLock()
Extending class must implement this function to actually acquire a lock.

[ Top ]
_closeLockFile  [line 187]

  void _closeLockFile( array $lockInfo  )

Close file for this lock and remove file if there are no more references.

Parameters:
array   $lockInfo:  lockInfo

API Tags:
Access:  private


[ Top ]
_getLockFile  [line 177]

  string _getLockFile( int $id  )

Return the lock file for a given object id.

Parameters:
int   $id:  the input id

API Tags:
Return:  the complete path to the lock file
Access:  private


[ Top ]
_newLockId  [line 215]

  void _newLockId( )


API Tags:
See:  GalleryLockSystem::_newLockId


Redefinition of:
GalleryLockSystem::_newLockId()
Generate an id for a new lock.

[ Top ]
_releaseLocksNow  [line 134]

  void _releaseLocksNow( $locks  )

Parameters:
   $locks: 

API Tags:
See:  GalleryLockSystem::_releaseLocksNow


Redefinition of:
GalleryLockSystem::_releaseLocksNow()
Release the given locks now

[ Top ]
_removeObjectsFromLock  [line 204]

  void _removeObjectsFromLock( &$lock, $ids  )

Parameters:
   &$lock: 
   $ids: 

API Tags:
See:  GalleryLockSystem::_removeObjectsFromLock


Redefinition of:
GalleryLockSystem::_removeObjectsFromLock()
Remove some object ids from the given lock.

[ Top ]

Documentation generated on Fri, 08 Oct 2010 04:52:48 -0700 by phpDocumentor 1.3.0RC6