|
From: Julian S. <js...@ac...> - 2014-11-25 12:40:45
|
On 11/25/2014 10:22 AM, Pohl, Hartmut wrote:
> What confuses me is that the stack trace incorrectly reports a data race
> between the first and the second test thread. Which is impossible and makes me
> think that maybe the pthread_join() is incorrectly handled by helgrind?
There are a bunch of stack traces in this message. Exactly which one is
the one you think is wrong?
I don't exactly understand the test program, but this ..
> bool wait = true;
> do
> {
> wait = atomicWait.syncLoad();
> ANNOTATE_HAPPENS_AFTER(atomicWait.getAddress());
> }
> while (wait) ;
.. doesn't feel right to me. You need to put the ANNOTATE_HAPPENS_AFTER
after the end of the while loop, not inside it, because merely reading
the value
> wait = atomicWait.syncLoad();
doesn't mean the thread can go forwards. It has to spin until that
value becomes |true|. So the h-b edge from the main thread "arrives
here" after the loop, not inside it.
J
|