In this example, thread 1 first set prev->next = 6, then thread 2 overwrite the result by setting prev->next = 7. Thus we lose the node with value 6.
In this case, we have a hanging node with value 6 pointing at 10
Please log in to leave a comment.
In this example, thread 1 first set prev->next = 6, then thread 2 overwrite the result by setting prev->next = 7. Thus we lose the node with value 6.