LPAR在目标系统上恢复执行。
如果恰在执行CAS之前线程失去执行权,那么在线程恢复执行之后,CAS会失败,继续循环,直到有有效的数据可用为止。
If there was thread preemption just before CAS, after resumption of the thread, CAS would fail, and the looping would continue until valid data were available.
接下来,线程 A 恢复执行,显然对于这个线程 *top 和 n->next 不匹配,因为线程 B 修改了 top 位置的内容。
Next, Thread A resumes, and clearly *top and n->next do not match for this thread, because Thread B modified the contents of the top location.
应用推荐