-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Windows InitOnceBeginInitialize and InitOnceComplete shims #2601
Conversation
I think rust-lang/rust#103198 should fix the CI failure when its merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this mostly looks great!
src/shims/windows/sync.rs
Outdated
InitOnceStatus::Begun => this.eval_windows("c", "TRUE")?, | ||
InitOnceStatus::Complete => this.eval_windows("c", "FALSE")?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I didn't know about these constants. But we should be consistent -- I think all the other Windows shims use Scalar::from_i32
to create their BOOL literals. If we're going with eval for this, can you make a separate PR changing the existing code?
src/shims/windows/sync.rs
Outdated
this.init_once_enqueue_and_block( | ||
id, | ||
active_thread, | ||
Box::new(Callback { init_once_id: id, pending_place }), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the callback into this match arm. It is confusing to read all that callback code and then realize it is only sometimes relevant.
In the interest of having our CI fixed, I plan to take over this PR later today so that it can land ASAP. I hope that's okay. |
03da888
to
1413857
Compare
1413857
to
c9b32cc
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Fixes #2595