Browse files

fix memory order in AtomicHashMap<>::findInternal()

Summary:
Looks like a typo, it should obviously be std::memory_order_relaxed (all
necessary synchronization is done on numMapsAllocated_).

Test Plan: compiled it, ran tests

Reviewed By: sahrens@fb.com

FB internal diff: D515322
  • Loading branch information...
1 parent dcf79b8 commit 5eeb75092e8eb24798907a39381f64c3404cbe56 @philippv philippv committed with tudor Jul 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 folly/AtomicHashMap-inl.h
View
2 folly/AtomicHashMap-inl.h
@@ -163,7 +163,7 @@ findInternal(const KeyT k) const {
int const numMaps = numMapsAllocated_.load(std::memory_order_acquire);
FOR_EACH_RANGE(i, 1, numMaps) {
// Check each map successively. If one succeeds, we're done!
- SubMap* thisMap = subMaps_[i].load(std::memory_order_release);
+ SubMap* thisMap = subMaps_[i].load(std::memory_order_relaxed);
ret = thisMap->findInternal(k);
if (LIKELY(ret.idx != thisMap->capacity_)) {
return SimpleRetT(i, ret.idx, ret.success);

0 comments on commit 5eeb750

Please sign in to comment.