这样,即使线程b在线程A试图弹出数据的同时修改了堆栈顶,也可以确保不会跳过堆栈中的元素。
With this arrangement, even if Thread B has modified the top while Thread a tries to pop, you're sure that no elements in the stack are skipped.
这样,即使线程b在线程A试图弹出数据的同时修改了堆栈顶,也可以确保不会跳过堆栈中的元素。
With this arrangement, even if Thread B has modified the top while Thread a tries to pop, you're sure that no elements in the stack are skipped.
应用推荐