Re:Lock-free Data Structures Part 1 – Introduction
by chacham15 on Tuesday May 06, 2014 @01:11AM
(#7702945)
You're right. Enqueue is wrong, it should be:
if ( !m_pHead )
m_pHead = p ;
else
m_pTail->next = p;
m_pTail = p;
For some reason, the author is inserting the node in front of the tail leading to the error.
Seems like you should need to traverse the list to dequeue.
Where did I go wrong?