We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59df5a8 commit 901118eCopy full SHA for 901118e
1 file changed
util/thread_safe_pool.hh
@@ -44,6 +44,13 @@ public:
44
return false;
45
}
46
47
+ // Acquire-load on the slot's used flag. Pairs with the release from create()/destroy()
48
+ bool is_used(size_t idx) const {
49
+ if (idx >= used_flags.size())
50
+ return false;
51
+ return used_flags[idx].load(std::memory_order_acquire);
52
+ }
53
+
54
void clear() {
55
for (size_t i = 0; i < MaxEntries; i++) {
56
data[i] = T{};
0 commit comments