Add needsPeerVerification function to check if peer cert should be verified
[folly.git] / folly / SharedMutex.h
index 24bce0d7c73a9b8328836bb23cd9d3c7eaf811b6..a0f79f5b32ac00e45d0b78a71d8ed9f23a2cb47c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1390,7 +1390,7 @@ bool SharedMutexImpl<ReaderPriority, Tag_, Atom, BlockImmediately>::
       return false;
     }
 
-    uint32_t slot;
+    uint32_t slot = tls_lastDeferredReaderSlot;
     uintptr_t slotValue = 1; // any non-zero value will do
 
     bool canAlreadyDefer = (state & kMayDefer) != 0;
@@ -1399,7 +1399,6 @@ bool SharedMutexImpl<ReaderPriority, Tag_, Atom, BlockImmediately>::
     bool drainInProgress = ReaderPriority && (state & kBegunE) != 0;
     if (canAlreadyDefer || (aboveDeferThreshold && !drainInProgress)) {
       /* Try using the most recent slot first. */
-      slot = tls_lastDeferredReaderSlot;
       slotValue = deferredReader(slot)->load(std::memory_order_relaxed);
       if (slotValue != 0) {
         // starting point for our empty-slot search, can change after