|
From: Patrick J. L. <lop...@gm...> - 2014-07-24 16:10:58
|
I have opened the following bug report against Helgrind: https://bugs.kde.org/show_bug.cgi?id=337735 A typical use for pthread_once() is one-time initialization of shared data. I am working on an existing code base that uses this idiom widely, but Helgrind incorrectly reports it as a data race. I have attached a simple stand-alone test case to the bug report. It is modeled after the tc21_pthonce test in the Helgrind regression suite. I have also attached my attempt at a patch to fix the bug. The patch fixes my simple test case, but I am not sure what I am doing is valid, and I am fairly certain it is not an approach the Helgrind maintainers would approve. I am willing to do the work to make my patch commit-worthy if the Helgrind maintainers would (a) agree this is a real bug and (b) give me some guidance on the approach I should take. Thanks! - Pat |