Swoole\Coroutine\Lock::trylock

Attempt to acquire the lock without blocking

&reftitle.description; public `bool` `Swoole\Coroutine\Lock::trylock`

When calling the lock operation, if the lock is already held by another coroutine, the function will immediately return false without suspending the current coroutine or yielding CPU control. This non-blocking design allows the caller to flexibly handle contention situations, such as retrying, giving up, or executing other logic.

&reftitle.parameters; &no.function.parameters;
&reftitle.returnvalues;

Returns `true` if the lock was acquired successfully, `false` if the lock is not available.