Boost logo

Boost :

Subject: Re: [boost] [atomic, x86] need another pair of eyes
From: Peter Dimov (lists_at_[hidden])
Date: 2012-12-22 10:23:11


Tim Blechmann wrote:

> unfortunately this test still failed on one of the sandia machines
> (gcc-4.7.1_0x) ...

I don't know if this is the cause of the failure, but the test still has a
race condition. If get() calls get_elements(), which returns false, and then
the writer pushes the last elements and sets running to false, get() will
then return.

I suppose it needs to be something along the lines of:

void get(void)
{
    while( running )
    {
        get_elements();
    }

    while( get_elements() );
}

or equivalent.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk