Commit 6405c78f authored by Xavier Thompson's avatar Xavier Thompson

gc.hpp: Explicitly load tail->_next

parent af98158c
...@@ -111,11 +111,16 @@ namespace typon::fdt::lock_free ...@@ -111,11 +111,16 @@ namespace typon::fdt::lock_free
{ {
while (auto tail = _tail.load()) while (auto tail = _tail.load())
{ {
if (tail->_stamp >= oldest || !tail->_next) if (tail->_stamp >= oldest)
{ {
break; break;
} }
if (_tail.compare_exchange_strong(tail, tail->_next)) auto next = tail->_next.load();
if (!next)
{
break;
}
if (_tail.compare_exchange_strong(tail, next))
{ {
delete tail; delete tail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment