aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/lock/flock.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-04 13:44:22 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-04 13:44:22 -0500
commit4cc81f1ffa62cdbcbb656300c7dd9fbd44cc21fc (patch)
treee50f647ab1e0f48ea8463c59065eb2f7de0c85b1 /phpBB/includes/lock/flock.php
parentfc410e1cd0071a2de3dc90ce62a5abbef0266f15 (diff)
downloadforums-4cc81f1ffa62cdbcbb656300c7dd9fbd44cc21fc.tar
forums-4cc81f1ffa62cdbcbb656300c7dd9fbd44cc21fc.tar.gz
forums-4cc81f1ffa62cdbcbb656300c7dd9fbd44cc21fc.tar.bz2
forums-4cc81f1ffa62cdbcbb656300c7dd9fbd44cc21fc.tar.xz
forums-4cc81f1ffa62cdbcbb656300c7dd9fbd44cc21fc.zip
[ticket/10103] Correct flock class documentation.
PHPBB3-10103
Diffstat (limited to 'phpBB/includes/lock/flock.php')
-rw-r--r--phpBB/includes/lock/flock.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/phpBB/includes/lock/flock.php b/phpBB/includes/lock/flock.php
index e24a5f3e1c..09450644bc 100644
--- a/phpBB/includes/lock/flock.php
+++ b/phpBB/includes/lock/flock.php
@@ -35,9 +35,9 @@ class phpbb_lock_flock
private $lock_fp;
/**
- * Creates an instance of the lock.
+ * Constructor.
*
- * You have to call acquire() to actually create the lock.
+ * You have to call acquire() to actually acquire the lock.
*
* @param string $path Path to the file access to which is controlled
*/
@@ -50,8 +50,17 @@ class phpbb_lock_flock
/**
* Tries to acquire the lock.
*
- * As a lock may only be held by one process at a time, lock
- * acquisition may fail if another process is holding the lock.
+ * If the lock is already held by another process, this call will block
+ * until the other process releases the lock. If a lock is acquired and
+ * is not released before script finishes but the process continues to
+ * live (apache/fastcgi) then subsequent processes trying to acquire
+ * the same lock will be blocked forever.
+ *
+ * If the lock is already held by the same process via another instance
+ * of this class, this call will block forever.
+ *
+ * If flock function is disabled in php or fails to work, lock
+ * acquisition will fail and false will be returned.
*
* @return bool true if lock was acquired
* false otherwise