Join 4,000+ others and never miss out on new tips, tutorials, and more.
Latest version:
pecl install openswoole-25.2.0 | composer require openswoole/core:22.1.5
Lock
can be used for data synchronization between multiple processes
.
Locks should not be used within coroutine context.
OpenSwoole\Lock->__construct
OpenSwoole\Lock->lock
OpenSwoole\Lock->lockwait
OpenSwoole\Lock->trylock
OpenSwoole\Lock->lock_read
OpenSwoole\Lock->trylock_read
OpenSwoole\Lock->unlock
Constant | Description |
---|---|
OpenSwoole\Constant::FILELOCK | file lock |
OpenSwoole\Constant::RWLOCK | read write lock |
OpenSwoole\Constant::SEM | Linux semaphore |
OpenSwoole\Constant::MUTEX | Mutex |
OpenSwoole\Constant::SPINLOCK | spin lock |