Skip to content

Commit 7079e7e

Browse files
committed
Merge pull request opencv#19480 from vrabaud:3.4
2 parents 4f39f8a + 847b16f commit 7079e7e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/core/src/parallel_impl.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,16 @@ class ParallelJob
382382
};
383383

384384

385+
// Disable thread sanitization check when CV_USE_GLOBAL_WORKERS_COND_VAR is not
386+
// set because it triggers as the main thread reads isActive while the children
387+
// thread writes it (but it all works out because a mutex is locked in the main
388+
// thread and isActive re-checked).
389+
// This is to solve issue #19463.
390+
#if !defined(CV_USE_GLOBAL_WORKERS_COND_VAR) && defined(__clang__) && defined(__has_feature)
391+
#if __has_feature(thread_sanitizer)
392+
__attribute__((no_sanitize("thread")))
393+
#endif
394+
#endif
385395
void WorkerThread::thread_body()
386396
{
387397
(void)cv::utils::getThreadID(); // notify OpenCV about new thread

0 commit comments

Comments
 (0)