我再次运行了这个程序,结果就跟教程完全一样。
你需要调试,看看Task1有没有释放mutex
输出如下:和教材中的结果不一样,为什么
Task1 take the Mutex Success
Task2: at first, take the Mutex Failed
教材中的结果:
Task1 take the Mutex Success
Task2: at first, take the Mutex Failed
Task2: give Mutes Success
Task2: and then, take the Mutes Sucess