smol-rs / async-broadcast

Async broadcast channels
Apache License 2.0
163 stars 26 forks source link

Replace the RwLock securing the inner data with a Mutex #42

Closed notgull closed 3 months ago

notgull commented 1 year ago

As of the time of writing, an RwLock is used to secure the inner data rather than a Mutex.

https://github.com/smol-rs/async-broadcast/blob/1fd1c29493a41bb60d4ebda56c4c82f0da478731/src/lib.rs#L296

However, it seems like most of the functions that use the inner data just use the write() method, and the usage of the read() method seems pretty rare. It might be best to replace the inner lock with a Mutex.

zeenix commented 1 year ago

Sure thing. If you do this, I think #41 is quite up your alley too since it'll make use of your new crate. :)