]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Lock/Lock.php
Merge pull request #7540 from vinzv/patch-1
[friendica.git] / src / Core / Lock / Lock.php
index 4418fee271bf029e1549cbabfa7fc05600dcd85d..f03ffe03d144e565f7f99f581b6685f46650edb2 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace Friendica\Core\Lock;
 
+use Friendica\Core\Cache\Cache;
+
 /**
  * Class AbstractLock
  *
@@ -11,6 +13,9 @@ namespace Friendica\Core\Lock;
  */
 abstract class Lock implements ILock
 {
+       const TYPE_DATABASE  = Cache::TYPE_DATABASE;
+       const TYPE_SEMAPHORE = 'semaphore';
+
        /**
         * @var array The local acquired locks
         */
@@ -49,16 +54,14 @@ abstract class Lock implements ILock
        }
 
        /**
-        * Releases all lock that were set by us
-        *
-        * @return boolean Was the unlock of all locks successful?
+        * {@inheritDoc}
         */
-       public function releaseAll()
+       public function releaseAll($override = false)
        {
                $return = true;
 
                foreach ($this->acquiredLocks as $acquiredLock => $hasLock) {
-                       if (!$this->releaseLock($acquiredLock)) {
+                       if (!$this->releaseLock($acquiredLock, $override)) {
                                $return = false;
                        }
                }