Avoid double-checked locking with TSAN in parallel
Omit the first check of the double-checked locking pattern in recordException() in parallel.cpp when CV_THREAD_SANITIZER is defined. This should only slow recordException() down when the thread sanitizer is used, and avoids the TSAN data race warning.
This commit is contained in:
parent
4009bca59a
commit
bf29a4d746
@ -263,7 +263,9 @@ namespace {
|
|||||||
void recordException(const cv::String& msg)
|
void recordException(const cv::String& msg)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifndef CV_THREAD_SANITIZER
|
||||||
if (!hasException)
|
if (!hasException)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
cv::AutoLock lock(cv::getInitializationMutex());
|
cv::AutoLock lock(cv::getInitializationMutex());
|
||||||
if (!hasException)
|
if (!hasException)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user