From faac856f213639fce78a02eaf7a67e490b7b70cb Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 15 Sep 2016 04:50:25 -0700 Subject: [PATCH] Fix broken wincache merge() implementation Bug: T145664 Change-Id: I2f841779108df281e24003c586775b71aa176909 --- includes/libs/objectcache/WinCacheBagOStuff.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } } -- 2.20.1