From 4748b2571fc02d5ebbfe59e457f0e8d8ef0eb5f3 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 6 May 2020 19:02:07 -0700 Subject: rt: simplify coop implementation (#2498) Simplifies coop implementation. Prunes unused code, create a `Budget` type to track the current budget. --- tokio/src/sync/rwlock.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tokio/src/sync/rwlock.rs') diff --git a/tokio/src/sync/rwlock.rs b/tokio/src/sync/rwlock.rs index 68cf710e..4e2fb74d 100644 --- a/tokio/src/sync/rwlock.rs +++ b/tokio/src/sync/rwlock.rs @@ -1,4 +1,3 @@ -use crate::coop::CoopFutureExt; use crate::sync::batch_semaphore::{AcquireError, Semaphore}; use std::cell::UnsafeCell; use std::ops; @@ -116,7 +115,7 @@ impl<'a, T> ReleasingPermit<'a, T> { lock: &'a RwLock, num_permits: u16, ) -> Result, AcquireError> { - lock.s.acquire(num_permits).cooperate().await?; + lock.s.acquire(num_permits).await?; Ok(Self { num_permits, lock }) } } -- cgit v1.2.3