async-rs / async-rs/async-std

Question: Can WakerSet be Send+Sync?

Open
#966 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

[WakerSet](https://github.com/async-rs/async-std/blob/master/src/sync/waker_set.rs) implements its own atomic locking mechanism but is not Send or Sync. The use of it in async-std [is accompanied by](https://github.com/async-rs/async-std/blob/master/src/sync/condvar.rs#L63-L64) unsafe impl Send and Sync for containing types, but that seems like it would be more appropriate to put on the type that provides the locking mechanism for locality of reference. Is there a reason that WakerSet isn't Send + Sync but Condvar is?

I'd happily open a PR to move the unsafe impl Send and Sync to WakerSet unless I've misunderstood something about the safety of this type

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.