阅读背景:

使用互斥锁的正确的代码是否仍然不稳定?

来源:互联网 

I've been doing pretty basic stuff with std::thread without any particular reason, simply in order to learn it. I thought that the simple example I created, where few threads are operating on the same data, locking each other before doing so, worked just fine, until I realized that every time I run it the returned value is different, while very close to each other, I am pretty sure they should equal each other. Some of the values I have received:I've been doing pretty basic stuff with std::th




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: