Stud.IP  3.1 Revision 48552
 All Data Structures Namespaces Files Functions Variables Groups Pages
StudipLock Class Reference
Collaboration diagram for StudipLock:
Collaboration graph

Static Public Member Functions

static getCurrent ()
static get ($lockname, $timeout=10)
static isFree ($lockname)
static release ()
static lockname ($lockname)

Member Function Documentation

static get (   $lockname,
  $timeout = 10 
)
static

Tries to obtain a lock with a name given by the string $lockname, using a timeout of $timeout seconds. Returns 1 if the lock was obtained successfully, 0 if the attempt timed out (for example, because another client has previously locked the name), or NULL if an error occurred If a name has been locked by one client, any request by another client for a lock with the same name is blocked.

Parameters
string$lockname
number$timeoutin seconds
Exceptions
UnexpectedValueExceptionif there is already an active lock
Returns
integer 1 if the lock was obtained successfully, 0 if the attempt timed out

Here is the caller graph for this function:

static getCurrent ( )
static

returns the name of the current active lock

Returns
string name of active lock
static isFree (   $lockname)
static

check if lock with given name is available

Parameters
string$lockname
Returns
integer 1 if lock is available

Here is the call graph for this function:

static lockname (   $lockname)
static

prepends the name of current database to lockname because locks are server-wide

Parameters
string$lockname
Returns
string
static release ( )
static

release the current lock

Returns
integer 1 if the lock could be released

Here is the call graph for this function:

Here is the caller graph for this function:


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