Add Windows InitOnceBeginInitialize and InitOnceComplete shims#2601
Conversation
|
I think rust-lang/rust#103198 should fix the CI failure when its merged. |
RalfJung
left a comment
There was a problem hiding this comment.
Thanks, this mostly looks great!
| InitOnceStatus::Begun => this.eval_windows("c", "TRUE")?, | ||
| InitOnceStatus::Complete => this.eval_windows("c", "FALSE")?, |
There was a problem hiding this comment.
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?
| 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.
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