Each thread will still run the callback, but only one will save the value back
Bug: T203786
Change-Id: Idc4738aa005cc44ec0f1adc6dcf2e3f87d0c9480
$this->setInterimValue( $key, $wrapped, $tempTTL );
}
$this->setInterimValue( $key, $wrapped, $tempTTL );
}
- if ( $valueIsCacheable ) {
+ // Save the value unless a mutex-winning thread is already expected to do that
+ if ( $valueIsCacheable && ( !$useMutex || $lockAcquired ) ) {
$setOpts['lockTSE'] = $lockTSE;
$setOpts['staleTTL'] = $staleTTL;
// Use best known "since" timestamp if not provided
$setOpts['lockTSE'] = $lockTSE;
$setOpts['staleTTL'] = $staleTTL;
// Use best known "since" timestamp if not provided