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

Method add

concurrentqueue.h:1481–1493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1479 FreeList& operator=(FreeList const&) MOODYCAMEL_DELETE_FUNCTION;
1480
1481 inline void add(N* node)
1482 {
1483#ifdef MCDBGQ_NOLOCKFREE_FREELIST
1484 debug::DebugLock lock(mutex);
1485#endif
1486 // We know that the should-be-on-freelist bit is 0 at this point, so it's safe to
1487 // set it using a fetch_add
1488 if (node->freeListRefs.fetch_add(SHOULD_BE_ON_FREELIST, std::memory_order_acq_rel) == 0) {
1489 // Oh look! We were the last ones referencing this node, and we know
1490 // we want to add it to the free list, so let's do it!
1491 add_knowing_refcount_is_zero(node);
1492 }
1493 }
1494
1495 inline N* try_get()
1496 {

Callers 1

add_block_to_free_listFunction · 0.45

Calls 1

fetch_addMethod · 0.45

Tested by

no test coverage detected