Skip to content

Instantly share code, notes, and snippets.

View JesseRMeyer's full-sized avatar

Jesse Meyer JesseRMeyer

View GitHub Profile
{ // usage code
auto tsgq = ThreadSafeQueue<AtomicGrowingQueue<int>, os::Futex>(8);
tsgq.Put(1);
assert(tsgq.Pop() == 1);
// AtomicStackAllocatedQueue takes different arguments than AtomicGrowingQueue but ThreadSafeQueue doesn't care
auto tsfq = ThreadSafeQueue<AtomicStackAllocatedQueue<10, int>, os::Futex>();
tsfq.Put(1);
assert(tsfq.Pop() == 1);
}