aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/lock
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-04-30 15:48:29 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-04-30 15:48:29 +0200
commit714092ab4e52dc039536a05846b50f4d4d488799 (patch)
tree0f31a91f6aa0aeddfe2d256d669e4e894228f808 /phpBB/includes/lock
parent055ee41065fb0b7c08c66daff196eb2d3460b0cc (diff)
downloadforums-714092ab4e52dc039536a05846b50f4d4d488799.tar
forums-714092ab4e52dc039536a05846b50f4d4d488799.tar.gz
forums-714092ab4e52dc039536a05846b50f4d4d488799.tar.bz2
forums-714092ab4e52dc039536a05846b50f4d4d488799.tar.xz
forums-714092ab4e52dc039536a05846b50f4d4d488799.zip
[ticket/11495] Add owns_lock() method to lock classes
PHPBB3-11495
Diffstat (limited to 'phpBB/includes/lock')
-rw-r--r--phpBB/includes/lock/db.php11
-rw-r--r--phpBB/includes/lock/flock.php11
2 files changed, 22 insertions, 0 deletions
diff --git a/phpBB/includes/lock/db.php b/phpBB/includes/lock/db.php
index ccdaed0b28..5cc0821aa0 100644
--- a/phpBB/includes/lock/db.php
+++ b/phpBB/includes/lock/db.php
@@ -117,6 +117,17 @@ class phpbb_lock_db
}
/**
+ * Does this process own the lock?
+ *
+ * @return bool true if lock is owned
+ * false otherwise
+ */
+ public function owns_lock()
+ {
+ return (bool) $this->locked;
+ }
+
+ /**
* Releases the lock.
*
* The lock must have been previously obtained, that is, acquire() call
diff --git a/phpBB/includes/lock/flock.php b/phpBB/includes/lock/flock.php
index 97bc7dd2b9..17de0847c0 100644
--- a/phpBB/includes/lock/flock.php
+++ b/phpBB/includes/lock/flock.php
@@ -111,6 +111,17 @@ class phpbb_lock_flock
}
/**
+ * Does this process own the lock?
+ *
+ * @return bool true if lock is owned
+ * false otherwise
+ */
+ public function owns_lock()
+ {
+ return (bool) $this->lock_fp;
+ }
+
+ /**
* Releases the lock.
*
* The lock must have been previously obtained, that is, acquire() call