Open
Conversation
Two arcs and one Box were all merged into one single Pin<Box<>> by using a self referential structure. Also, a dynamic dyspatch as removed in favor of using generics
It was possible that a thread would read resync as false before another thread set it to true and subsequently register a waker after the other thread set resync to true and already tried calling AtomicWaker::wake(). To fix this issue, we first register the waker, and only then we check the resync value. If resync is true and we didn't have to register the waker, we just take it back.
Author
|
Fixed |
jxs
reviewed
Feb 12, 2026
Member
jxs
left a comment
There was a problem hiding this comment.
Hi, thanks for this and sorry for delay!
Looking into the comment you left on the issue
Registering the Waker before loading resync would fix this issue, with the added side of effect of possible spurious wakes. However, spurious wakes should always be expected when dealing with Future. Another approach, would be to have both resync and waker inside a mutex, then we can read resync and set the waker on the same critical area.
I think the simplest solution would probably be to just have resync be a Mutex (we can register the Waker with it locked).
This would avoid all these unsafe uses right?
Thanks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #44