]> git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/commitdiff
AsyncPool: simplify atomic counter usage
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 25 Oct 2024 14:26:09 +0000 (16:26 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 25 Oct 2024 14:26:09 +0000 (16:26 +0200)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/async_pool.rs

index 262825fc636a827781791f7b15832f25bb122612..bc4d80c41e9ac39ddc7bdf946ba2850b7e462173 100644 (file)
@@ -42,8 +42,7 @@ impl AsyncPool {
     {
         let (future, abort_handle) = abortable(future);
         let abort_handles = Rc::clone(&self.inner.abort_handles);
-        self.inner.id_counter.fetch_add(1, Ordering::Relaxed);
-        let abort_id = self.inner.id_counter.load(Ordering::Relaxed);
+        let abort_id = self.inner.id_counter.fetch_add(1, Ordering::Relaxed);
 
         abort_handles.borrow_mut().insert(abort_id, abort_handle);