spunQ_Mutex Class Reference

Mutex implementation using file locking. More...

Inheritance diagram for spunQ_Mutex:

spunQ_IMutex

List of all members.

Public Member Functions

 tryAcquiring ($timeout=0)
 Tries to acquires this mutex.
 release ()
 Releases this mutex.

Static Public Member Functions

static get ($name)
 Provides the mutex with given name.

Protected Attributes

 $file
 The file we're locking.

Static Protected Attributes

static $instances = array()
 All instances of this class, indexed by their name.

Private Member Functions

 __construct ($name)
 Constructor.


Detailed Description

Mutex implementation using file locking.

See also:
spunQ_File::lock()

Definition at line 7 of file Mutex.class.php.


Constructor & Destructor Documentation

spunQ_Mutex::__construct ( name  )  [private]

Constructor.

Parameters:
$name Name of the mutex to acquire.

Definition at line 38 of file Mutex.class.php.


Member Function Documentation

static spunQ_Mutex::get ( name  )  [static]

Provides the mutex with given name.

Parameters:
$name Name of the mutex to acquire. Multiple calls with the same name will return the same object.
Returns:
spunQ_Mutex

Definition at line 21 of file Mutex.class.php.

spunQ_Mutex::release (  ) 

Releases this mutex.

Returns:
strg_IMutex $this

Implements spunQ_IMutex.

Definition at line 53 of file Mutex.class.php.

spunQ_Mutex::tryAcquiring ( timeout = 0  ) 

Tries to acquires this mutex.

Parameters:
$timeout Amount of seconds the function should block until the lock is acquired. Setting this to NULL will block indefinitely (until max_execution_time runs out). The default value of 0 will not block at all.
Returns:
boolean Whether the mutex was successfully acquired.

Implements spunQ_IMutex.

Definition at line 46 of file Mutex.class.php.


Member Data Documentation

spunQ_Mutex::$file [protected]

The file we're locking.

Type:
spunQ_File

Definition at line 32 of file Mutex.class.php.

spunQ_Mutex::$instances = array() [static, protected]

All instances of this class, indexed by their name.

Type:
array<spunQ_Mutex>

Definition at line 13 of file Mutex.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:43 2011 for spunQ3 by  doxygen 1.5.9