我正在运行一个带有线程清理程序的程序,并且想知道如何解释以下警告:
==================
WARNING: ThreadSanitizer: data race (pid=2788668)
Read of size 4 at 0x7f7eefc4e298 by main thread:
[Stacktrace follows...]
Previous write of size 8 at 0x7f7eefc4e298 by thread T27:
[Stacktrace follows...]
Location is heap block of size 307272 at 0x7f7eefc1c000 allocated by thread T27
[Stacktrace follows...]
Thread T27 (tid=2790352, running) created by main thread at:
[Stacktrace follows...]
==================
我将此消息解释为只是说主线程读取了以前由不同线程写入的内存。不同的线程是由主线程创建的,这个不同的线程也分配了内存。这个对吗?如果是这样,有没有办法在接下来的运行中抑制这个特定的警告?