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

Method ThreadLocal

tests/corealgos.h:167–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165struct ThreadLocal
166{
167 explicit ThreadLocal(std::size_t initialHashSize)
168 : initialHashEntries(initialHashSize)
169 {
170 assert(initialHashSize > 0 && (initialHashSize & (initialHashSize - 1)) == 0);
171
172 resizeInProgress.clear();
173 currentHashCount.store(0, std::memory_order_relaxed);
174 auto hash = &initialHash;
175 hash->capacity = initialHashSize;
176 hash->entries = &initialHashEntries[0];
177 for (std::size_t i = 0; i != initialHashSize; ++i) {
178 initialHashEntries[i].key.store(details::invalid_thread_id, std::memory_order_relaxed);
179 }
180 hash->prev = nullptr;
181 currentHash.store(hash, std::memory_order_relaxed);
182 }
183
184 ~ThreadLocal()
185 {

Callers

nothing calls this directly

Calls 3

assertClass · 0.85
clearMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected