Documentation

MutexInterface

A locking mechanism.

Table of Contents

Methods

acquire()  : bool
Acquire the lock.
release()  : bool
Release the lock.

Methods

acquire()

Acquire the lock.

public acquire([float $timeout = 0 ]) : bool

Return true if the lock is acquired, false if it is already held.

If the timeout is zero, the method always returns immediately regardless if the lock is acquired or not.

Given a positive timeout, the method will wait for the previous lock to release before acquiring or giving up.

Parameters
$timeout : float = 0

in seconds

Return values
bool

release()

Release the lock.

public release() : bool

Returns true on success, false if the lock is already released.

Return values
bool
On this page

Search results