std::thread problems

后端 未结 2 1992
太阳男子
太阳男子 2021-02-04 14:41

I think I have a kind really bad concepts problems. Why I simple get a lot of race conditions error with valgrind. First i thought that could be a bug, and I saw in forums that

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-04 15:31

    Read the fabulous manual: http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html#debug.races

    The code is OK, valgrind doesn't understand the atomic operations we use inside std::shared_ptr and incorrectly reports them as races.

提交回复
热议问题