2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-02-28 23:29:41 +00:00

add Sync constraint for RwLock to prevent memory unsafety (#479)

This commit is contained in:
laizy 2019-11-08 16:56:55 +08:00 committed by Stjepan Glavina
parent ab2f64cd84
commit fb19ebde17

View file

@ -57,7 +57,7 @@ pub struct RwLock<T> {
}
unsafe impl<T: Send> Send for RwLock<T> {}
unsafe impl<T: Send> Sync for RwLock<T> {}
unsafe impl<T: Send + Sync> Sync for RwLock<T> {}
impl<T> RwLock<T> {
/// Creates a new reader-writer lock.