@@ -203,10 +203,10 @@ as seconds) and ``isExpired()`` (which returns a boolean).
203
203
Automatically Releasing The Lock
204
204
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205
205
206
- A Lock will be automatically released when the Lock object is destructed. This is
207
- an implementation detail that will be important when Locks are shared between processes.
208
- In the example below, the ``pcntl_fork() `` will create two processes and the Lock
209
- will be released automatically as soon as one process finishes::
206
+ Lock are automatically released when their Lock objects are destructed. This is
207
+ an implementation detail that will be important when sharing Locks between
208
+ processes. In the example below, ``pcntl_fork() `` creates two processes and the
209
+ Lock will be released automatically as soon as one process finishes::
210
210
211
211
// ...
212
212
$lock = $factory->createLock('report-generation', 3600);
@@ -215,7 +215,7 @@ will be released automatically as soon as one process finishes::
215
215
}
216
216
217
217
$pid = pcntl_fork();
218
- if ($pid == -1 ) {
218
+ if (-1 === $pid ) {
219
219
// Could not fork
220
220
exit(1);
221
221
} elseif ($pid) {
@@ -228,9 +228,9 @@ will be released automatically as soon as one process finishes::
228
228
}
229
229
// ...
230
230
231
- To disable this behavior, one needs to set the 3rd argument to the `` LockFactory::createLock() ``
232
- to false . That will make the Lock acquired for 3600 seconds or until `` Lock::release() ``
233
- is called.
231
+ To disable this behavior, set to `` false `` the third argument of
232
+ `` LockFactory::createLock() `` . That will make the lock acquired for 3600 seconds
233
+ or until `` Lock::release() `` is called.
234
234
235
235
The Owner of The Lock
236
236
---------------------
0 commit comments