Java线程

在Java中没有信号量机制。主要用的是互斥锁,来进行互斥或同步的

对一个变量加上volatile修饰符,就保证了这个变量的些是必须在这个变量的读前面的。

This guarantees that any write to message (as in "Key statement 1") will have a happens-before relationship with any subsequent reads 

posted on 2015-06-09 21:37  eyyzx678  阅读(111)  评论(0)    收藏  举报