From: Aaron Schulz Date: Thu, 15 Sep 2016 11:50:25 +0000 (-0700) Subject: Fix broken wincache merge() implementation X-Git-Tag: 1.31.0-rc.0~5555^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/Foo_bar_baz?a=commitdiff_plain;h=faac856f213639fce78a02eaf7a67e490b7b70cb;p=lhc%2Fweb%2Fwiklou.git Fix broken wincache merge() implementation Bug: T145664 Change-Id: I2f841779108df281e24003c586775b71aa176909 --- diff --git a/includes/libs/objectcache/WinCacheBagOStuff.php b/includes/libs/objectcache/WinCacheBagOStuff.php index 19cc66a8ba..6996ce54c3 100644 --- a/includes/libs/objectcache/WinCacheBagOStuff.php +++ b/includes/libs/objectcache/WinCacheBagOStuff.php @@ -65,6 +65,13 @@ class WinCacheBagOStuff extends BagOStuff { } public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { - return $this->mergeViaCas( $key, $callback, $exptime, $attempts ); + if ( wincache_lock( $key ) ) { // optimize with FIFO lock + $ok = $this->mergeViaLock( $key, $callback, $exptime, $attempts, $flags ); + wincache_unlock( $key ); + } else { + $ok = false; + } + + return $ok; } }