Clean up before returning

This commit is contained in:
Peter Conrad 2019-09-17 08:06:58 +02:00
parent eb42ebb528
commit 4ce3775630

View file

@ -61,7 +61,11 @@ namespace fc {
}
_enqueue_thread();
// Need to check _ready again to avoid a race condition.
if( _ready.load() ) return _wait_until( timeout_us ); // this will simply return or throw _exceptp
if( _ready.load() )
{
_dequeue_thread();
return _wait_until( timeout_us ); // this will simply return or throw _exceptp
}
std::exception_ptr e;
//