MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / find

Method find

tests/relacy/spmchash.cpp:54–60  ·  view source on GitHub ↗

Thread-safe, but if somebody can remove the key while find() is in progress, then any returned value is not guaranteed to correspond to that key. This also applies if the key was not already present but once was. Elements can be found in any order.

Source from the content-addressed store, hash-verified

52 // to that key. This also applies if the key was not already present but
53 // once was. Elements can be found in any order.
54 TValue* find(std::uint64_t key)
55 {
56 auto idxEntry = get_entry_for_key(key);
57 if (idxEntry == nullptr)
58 return nullptr;
59 return idxEntry->value.load(std::memory_order_acquire);
60 }
61
62 // Thread-safe, but if somebody else can remove the same key while remove()
63 // is in progress, then any removed value is not guaranteed to correspond

Callers 8

threadMethod · 0.45
add_accountMethod · 0.45
transfer_balanceMethod · 0.45
get_addr_hashMethod · 0.45
freeFunction · 0.45
core_spmc_hashMethod · 0.45
validateTestNameMethod · 0.45
runMethod · 0.45

Calls 1

loadMethod · 0.45

Tested by 3

core_spmc_hashMethod · 0.36
validateTestNameMethod · 0.36
runMethod · 0.36