We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c473e3f commit ea1f24dCopy full SHA for ea1f24d
1 file changed
fastpool/src/bounded.rs
@@ -201,13 +201,13 @@ impl<M: ManageObject> Pool<M> {
201
/// maximum size, this method would block until an object is returned to the pool or an object
202
/// is detached from the pool.
203
pub async fn get(self: &Arc<Self>) -> Result<Object<M>, M::Error> {
204
- let permit = self.permits.clone().acquire_owned(1).await;
205
-
206
self.users.fetch_add(1, Ordering::Relaxed);
207
let guard = scopeguard::guard((), |()| {
208
self.users.fetch_sub(1, Ordering::Relaxed);
209
});
210
+ let permit = self.permits.clone().acquire_owned(1).await;
+
211
let object = loop {
212
let existing = match self.config.queue_strategy {
213
QueueStrategy::Fifo => self.slots.lock().deque.pop_front(),
0 commit comments