因此,代码回到循环的开头,指向正确的top指针(线程b修改后的),调用CAS,把20压入堆栈后结束。
So, the code loops back, points to the proper top pointer (which was changed because of Thread b), invokes CAS, and is done with pushing 20 into the stack.
尽管线程被中断,但并没有结束运行。这行代码还是会被执行。
System. out. println " this line is also executed." thread does not stopped .
尽管线程被中断,但并没有结束运行。这行代码还是会被执行。
System. out. println " this line is also executed." thread does not stopped .
应用推荐