Skip to content

Commit 9c44f36

Browse files
authored
Merge pull request #273 from Acretock/master
Fix unreachable code warning in Win debug
2 parents 550a9aa + f38d497 commit 9c44f36

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

concurrentqueue.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,13 +2906,15 @@ class ConcurrentQueue
29062906
else if (!new_block_index()) {
29072907
return false;
29082908
}
2909-
localBlockIndex = blockIndex.load(std::memory_order_relaxed);
2910-
newTail = (localBlockIndex->tail.load(std::memory_order_relaxed) + 1) & (localBlockIndex->capacity - 1);
2911-
idxEntry = localBlockIndex->index[newTail];
2912-
assert(idxEntry->key.load(std::memory_order_relaxed) == INVALID_BLOCK_BASE);
2913-
idxEntry->key.store(blockStartIndex, std::memory_order_relaxed);
2914-
localBlockIndex->tail.store(newTail, std::memory_order_release);
2915-
return true;
2909+
else {
2910+
localBlockIndex = blockIndex.load(std::memory_order_relaxed);
2911+
newTail = (localBlockIndex->tail.load(std::memory_order_relaxed) + 1) & (localBlockIndex->capacity - 1);
2912+
idxEntry = localBlockIndex->index[newTail];
2913+
assert(idxEntry->key.load(std::memory_order_relaxed) == INVALID_BLOCK_BASE);
2914+
idxEntry->key.store(blockStartIndex, std::memory_order_relaxed);
2915+
localBlockIndex->tail.store(newTail, std::memory_order_release);
2916+
return true;
2917+
}
29162918
}
29172919

29182920
inline void rewind_block_index_tail()

0 commit comments

Comments
 (0)