在Java中没有信号量机制。主要用的是互斥锁,来进行互斥或同步的
对一个变量加上volatile修饰符,就保证了这个变量的些是必须在这个变量的读前面的。
This guarantees that any write to message (as in "Key statement 1") will have a happens-before relationship with any subsequent reads
message