Skip to content

Conversation

purplesyringa
Copy link
Contributor

Closes #135.

This enables the executor to be used in presence of panics in user callbacks, such as the iterator and impl Extend in spawn_many.

Mutex poisoning is more of a lint than a safety requirement, as containers (such as Slab) and wakers have to be sound in presence of panics anyway. In this particular case, the exact behavior of active is not relied upon for soundness.

Closes smol-rs#135.

This enables the executor to be used in presence of panics in user
callbacks, such as the iterator and `impl Extend` in `spawn_many`.

Mutex poisoning is more of a lint than a safety requirement, as
containers (such as `Slab`) and wakers have to be sound in presence of
panics anyway. In this particular case, the exact behavior of `active`
is not relied upon for soundness.
Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Looks good to me. I guess my main question would be "what happens to the tasks that are already spawned", but I think this is answered now.

@notgull notgull merged commit 0c216e8 into smol-rs:master Dec 3, 2024
8 checks passed
@taiki-e taiki-e mentioned this pull request Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Executor is unusable after spawn_many iterator panics

2 participants