[BUGFIX] Correctly remember acquired shared locks 84/34384/2
authorLudwig Rafelsberger <ludwig.rafelsberger@gmx.at>
Wed, 19 Nov 2014 23:19:42 +0000 (00:19 +0100)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Thu, 20 Nov 2014 11:38:44 +0000 (12:38 +0100)
If a shared lock is acquired, that fact must be remembered in the
Locker object, so that it can be properly released later.

Resolves: #63087
Releases: master, 6.2
Change-Id: Ic7b59d3c437a71193c580b279a6795aaad334108
Reviewed-on: http://review.typo3.org/34384
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
typo3/sysext/core/Classes/Locking/Locker.php

index f3ae595..1d30770 100644 (file)
@@ -309,17 +309,16 @@ class Locker {
                if ($this->isAcquired) {
                        return TRUE;
                }
-               $isAcquired = FALSE;
                if ($this->method === self::LOCKING_METHOD_FLOCK) {
                        $this->filePointer = fopen($this->resource, 'c');
                        if ($this->filePointer === FALSE) {
                                throw new \RuntimeException('Lock file could not be opened', 1294586099);
                        }
                        if (flock($this->filePointer, LOCK_SH)) {
-                               $isAcquired = TRUE;
+                               $this->isAcquired = TRUE;
                        }
                }
-               return $isAcquired;
+               return $this->isAcquired;
        }
 
        /**