Skip to content

Fix FIXME: thread-safe initialization of DispatchInitializer#844

Merged
vgvassilev merged 1 commit intocompiler-research:mainfrom
voyager-jhk:fix-fixme
Mar 25, 2026
Merged

Fix FIXME: thread-safe initialization of DispatchInitializer#844
vgvassilev merged 1 commit intocompiler-research:mainfrom
voyager-jhk:fix-fixme

Conversation

@voyager-jhk
Copy link
Copy Markdown
Contributor

Fix FIXME regarding thread-safe initialization of DispatchInitializer.

This change replaces the global static instance with a function-local
static to guarantee thread-safe initialization according to C++11.

The initializer is now created via GetDispatchInitializer().

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.75%. Comparing base (18fc9da) to head (61f4f79).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #844   +/-   ##
=======================================
  Coverage   79.75%   79.75%           
=======================================
  Files          11       11           
  Lines        4031     4031           
=======================================
  Hits         3215     3215           
  Misses        816      816           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Copy link
Copy Markdown
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

Any chance for a test?

@voyager-jhk
Copy link
Copy Markdown
Contributor Author

Any chance for a test?

Thanks! I've pushed a fix to restore the initialization trigger.

It looks like CI didn't run for the latest commit. Could you please rerun it?

@mcbarton
Copy link
Copy Markdown
Collaborator

Any chance for a test?

Thanks! I've pushed a fix to restore the initialization trigger.

It looks like CI didn't run for the latest commit. Could you please rerun it?

@voyager-jhk The ci doesn't run automatically for those who are contributing for the first time. It needs to be manually run. You will need to rebase as well to fix the Emscripten ci.

@aaronj0
Copy link
Copy Markdown
Collaborator

aaronj0 commented Mar 11, 2026

This is a one-time initialisation for the CppInterOpDispatchTests binary and not thread-safe for the tests (this is not called by each test). We need a single instance creation in Utils.cpp for the API to be loaded at runtime... Unless this fixes some use of gtest_parallel across binaries, I don't see what this patch achieves

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Collaborator

@aaronj0 aaronj0 left a comment

Choose a reason for hiding this comment

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

LGMT, thanks!

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@aaronj0
Copy link
Copy Markdown
Collaborator

aaronj0 commented Mar 24, 2026

@voyager-jhk Can you rebase on main and squash into a single commit? I'd like the Native jobs on the CI to run before taking this in

@voyager-jhk
Copy link
Copy Markdown
Contributor Author

@voyager-jhk Can you rebase on main and squash into a single commit? I'd like the Native jobs on the CI to run before taking this in

Done.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev vgvassilev merged commit c44c507 into compiler-research:main Mar 25, 2026
62 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants