Skip to content

Remove OS Thread from Atomics Wait Async#989

Open
komyg wants to merge 8 commits into
trynova:mainfrom
komyg:fix/remove-thread-from-wait-async
Open

Remove OS Thread from Atomics Wait Async#989
komyg wants to merge 8 commits into
trynova:mainfrom
komyg:fix/remove-thread-from-wait-async

Conversation

@komyg
Copy link
Copy Markdown
Contributor

@komyg komyg commented May 7, 2026

No description provided.

@komyg komyg changed the title Fix/remove thread from wait async Remove OS Thread from Atomics Wait Async May 7, 2026
Copy link
Copy Markdown
Member

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

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

Generally looks good to me, but I had a few nitpicks regarding the inline comments that I'd like to fix before merging :)


// SAFETY: buffer is a cloned SharedDataBlock; non-dangling.
let waiters = unsafe { self.0.data_block.get_or_init_waiters() };
// a. Perform EnterCriticalSection(WL).
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.

nitpick (but blocking): I'd like to see here a reference to where these steps are coming from. Possibly also a link to the relevant spec method.

));
}
}
// c. Perform LeaveCriticalSection(WL).
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.

nitpick (blocking): Step b is missing. I assume that'd be removing the waiter from the list, but I'd want to see it.

gc,
));
}
WaitResult::TimedOut => {
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.

thought: The string could be created from some WaitResult::to_string method to combine the two paths into a single try_resolve(agent, result.to_string(), gc).

}

// SAFETY: buffer is a cloned SharedDataBlock; non-dangling.
let waiters = unsafe { self.0.data_block.get_or_init_waiters() };
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.

nitpick: This seems like it could be a helper method.

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.

2 participants