This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你前面提到的volatile的使用方法是正确的,但是对于信号量不需要使用这个关键字,因为信号量的post和pend通知机制是操作系统内部实现的,不依赖于编译器的volatile功能。