diff options
author | Zahari Dichev <zaharidichev@gmail.com> | 2020-10-23 20:07:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-23 10:07:00 -0700 |
commit | e804f88d60071f0d89db85aaa4a073857904b545 (patch) | |
tree | 2450fdc093b9f361573febc7f7ca22b0275ae1c6 /tokio/src/net/unix/datagram/socket.rs | |
parent | c1539132110d3f8d20d22efb4b3f6a16fafd0e63 (diff) |
sync: add mem::forget to RwLockWriteGuard::downgrade. (#2957)
Currently when `RwLockWriteGuard::downgrade` the `MAX_READS - 1`
permits are added to the semaphore. When `RwLockWriteGuard::drop`
gets invoked however another `MAX_READS` permits are added. This
results in releasing more permits that were actually aquired when
downgrading a write to a read lock. This is why we need to call
`mem::forget` on the `RwLockWriteGuard` in order to avoid
invoking the destructor.
Fixes: #2941
Diffstat (limited to 'tokio/src/net/unix/datagram/socket.rs')
0 files changed, 0 insertions, 0 deletions