Skip to content

Disable thread sanitization check when CV_USE_GLOBAL_WORKERS_COND_VAR is not set.#19480

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
vrabaud:3.4
Feb 9, 2021
Merged

Disable thread sanitization check when CV_USE_GLOBAL_WORKERS_COND_VAR is not set.#19480
opencv-pushbot merged 1 commit intoopencv:3.4from
vrabaud:3.4

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Feb 8, 2021

This fixes #19463

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
force_builders=linux,docs,mac,ARMv7,Custom
build_image:Custom=centos:7
buildworker:Custom=linux-1,linux-4,linux-6

@asmorkalov asmorkalov requested a review from alalek February 9, 2021 07:44
@vrabaud vrabaud changed the title Fix isActive race condition. Disable thread sanitization check when CV_USE_GLOBAL_WORKERS_COND_VAR is not set. Feb 9, 2021
// thread writes it (but it all works out because a mutex is locked in the main
// thread and isActive re-checked).
#if !defined(CV_USE_GLOBAL_WORKERS_COND_VAR) && defined(__has_feature) && __has_feature(thread_sanitizer)
__attribute__((no_sanitize("thread")))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined(__has_feature) && __has_feature(thread_sanitizer)

Perhaps this should be split on multiple nested #if conditions.
Probably this should be guarder by defined(__clang__) too.


It makes sense to add link to the issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@opencv-pushbot opencv-pushbot merged commit 7079e7e into opencv:3.4 Feb 9, 2021
@alalek alalek mentioned this pull request Feb 12, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants