Mutex
PHP Manual

Mutex::trylock

(PECL pthreads >= 0.0.33)

Mutex::trylockTo attempt to lock a Mutex without blocking.

说明

final public static boolean Mutex::trylock ( long $mutex )

Attempt to lock the Mutex for the caller without blocking if the Mutex is owned (locked) by another Thread.

参数

mutex

A handle returned by a previous call to Mutex::create().

返回值

A boolean indication of success.


Mutex
PHP Manual