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

Method add

tests/corealgos.h:402–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400 FreeList() : freeListHead(nullptr) { }
401
402 inline void add(N* node)
403 {
404 // We know that the should-be-on-freelist bit is 0 at this point, so it's safe to
405 // set it using a fetch_add
406 if (node->freeListRefs.fetch_add(SHOULD_BE_ON_FREELIST, std::memory_order_acq_rel) == 0) {
407 // Oh look! We were the last ones referencing this node, and we know
408 // we want to add it to the free list, so let's do it!
409 add_knowing_refcount_is_zero(node);
410 }
411 }
412
413 inline N* try_get()
414 {

Callers 1

get_or_createMethod · 0.45

Calls 1

fetch_addMethod · 0.45

Tested by

no test coverage detected