Llvm thread sanitizer and qmutex
we make heavy use of Qt in our software and are now trying to use llvm thread sanitizer for debugging. Unfortunately the sanitizer doesn't seem to recognize QMutex as a locking mechanism.
The example below warns about a race condition because the member "data" is accessed in two threads. If you use a boost::mutex instead, the warning disappears. If "data" is a global variable, the false warning is not shown also.
What are the differences between the two mutex variants? Shouldn't both use pthread_mutex internally on a linux system? Are there any experiences in debugging Qt programs with llvm thread sanitizer?
Thanks in advance,
data = 1;
TestClass *tc = new TestClass;
QFuture<void> t1 = QtConcurrent::run(tc, &TestClass::fun);
QFuture<void> t2 = QtConcurrent::run(tc, &TestClass::fun);
Hi and welcome to devnet,
I would advise to bring this topic on the interest mailing list. You'll find there Qt's developers/maintainers (this forum is more user oriented)
Thanks for this tip. My question was answered on the interest mailing list: