| 1386 | FreeList &operator=(FreeList const &) MOODYCAMEL_DELETE_FUNCTION; |
| 1387 | |
| 1388 | inline void add(N *node) { |
| 1389 | #if MCDBGQ_NOLOCKFREE_FREELIST |
| 1390 | debug::DebugLock lock(mutex); |
| 1391 | #endif |
| 1392 | // We know that the should-be-on-freelist bit is 0 at this point, so it's safe to |
| 1393 | // set it using a fetch_add |
| 1394 | if (node->freeListRefs.fetch_add(SHOULD_BE_ON_FREELIST, std::memory_order_acq_rel) == 0) { |
| 1395 | // Oh look! We were the last ones referencing this node, and we know |
| 1396 | // we want to add it to the free list, so let's do it! |
| 1397 | add_knowing_refcount_is_zero(node); |
| 1398 | } |
| 1399 | } |
| 1400 | |
| 1401 | inline N *try_get() { |
| 1402 | #if MCDBGQ_NOLOCKFREE_FREELIST |
no outgoing calls
no test coverage detected