Not thread safe. Only call from single producer thread. Note: key must *not* be in hash already, and must be exactly one larger than the previously inserted key value.
| 41 | // Note: key must *not* be in hash already, and must be exactly |
| 42 | // one larger than the previously inserted key value. |
| 43 | void insert(std::uint64_t key, TValue* value) |
| 44 | { |
| 45 | IndexEntry* idxEntry; |
| 46 | insert_index_entry(idxEntry, key); |
| 47 | idxEntry->value.store(value, std::memory_order_release); |
| 48 | } |
| 49 | |
| 50 | // Thread-safe, but if somebody can remove the key while find() is |
| 51 | // in progress, then any returned value is not guaranteed to correspond |