Example #1
0
    void get_items(void)
    {
        for (;;)
        {
            long id;

            bool got = stk.pop(&id);
            if (got)
            {
                bool erased = data.erase(id);
                assert(erased);
                ++pop_count;
            }
            else if (not running)
                return;
        }
    }
Example #2
0
void get_items(void)
{
    for (;;)
    {
        thread::yield();
        long id;

        bool got = stk.pop(&id);
        if (got)
        {
            bool erased = data.erase(id);
            assert(erased);
        }
        else
            if (not running)
                return;
    }
}