Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: add mem::forget to RwLockWriteGuard::downgrade. #2957

Merged
merged 2 commits into from Oct 23, 2020

Commits on Oct 14, 2020

  1. sync: add mem::forget to RwLockWriteGuard::downgrade.

    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: tokio-rs#2941
    zaharidichev committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    3b39d70 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2020

  1. include loom_rwlock.rs

    zaharidichev committed Oct 15, 2020
    Configuration menu
    Copy the full SHA
    78b1ceb View commit details
    Browse the repository at this point in the history