Class MLA (Media Library Assistant) Mutex provides a simple "mutual exclusion" semaphore for the [mla_gallery] mla_viewer=single option
Adapted from the example by mr.smaon@gmail.com in the PHP Manual "Semaphore Functions" page.
| package |
Media Library Assistant |
|---|---|
| since | 2.10 |
__construct(boolean $use_lock = false) : void
| since | 2.10 |
|---|
booleanTrue to force use of file locking
acquire() : boolean
| since | 2.10 |
|---|---|
booleanTrue if the acquisition succeeded
getId() : resource
| since | 2.10 |
|---|---|
resourceSemaphore identifier or NULL
init(integer $id, string $filename = '') : boolean
| since | 2.10 |
|---|
integerKey to identify the semaphore
stringAbsolute path and name of the file for locking
booleanTrue if the initialization succeeded
release() : boolean
| since | 2.10 |
|---|---|
booleanTrue if the release succeeded
sem_id : resource
| since | |
|---|---|
| var |
resource
is_acquired : boolean
| since | |
|---|---|
| var |
boolean
use_file_lock : boolean
| since | |
|---|---|
| var |
boolean
filename : string
| since | |
|---|---|
| var |
string
filepointer : resource
| since | |
|---|---|
| var |
resource