From 75967916d42abf229446da90eea7a35de03452d7 Mon Sep 17 00:00:00 2001 From: wuhuiquan Date: Thu, 30 May 2024 16:43:05 +0800 Subject: [PATCH] test ci Signed-off-by: wuhuiquan --- ylong_runtime/src/executor/queue.rs | 4 ++-- ylong_runtime/src/sync/mpsc/bounded/array.rs | 2 +- ylong_runtime/src/sync/mpsc/unbounded/queue.rs | 2 +- ylong_runtime/src/sync/oneshot.rs | 2 +- ylong_runtime/src/sync/rwlock.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ylong_runtime/src/executor/queue.rs b/ylong_runtime/src/executor/queue.rs index e034acd..22bb808 100644 --- a/ylong_runtime/src/executor/queue.rs +++ b/ylong_runtime/src/executor/queue.rs @@ -214,7 +214,7 @@ impl InnerBuffer { wrap(steal_pos, next_real) }; - let res = self.front.compare_exchange(head, next, AcqRel, Acquire); + let res = self.front.compare_exchange_weak(head, next, AcqRel, Acquire); match res { Ok(_) => break real_pos, Err(actual) => head = actual, @@ -365,7 +365,7 @@ impl InnerBuffer { let res = self .front - .compare_exchange(src_prev_front, src_next_front, AcqRel, Acquire); + .compare_exchange_weak(src_prev_front, src_next_front, AcqRel, Acquire); match res { Ok(_) => break n, Err(actual) => src_prev_front = actual, diff --git a/ylong_runtime/src/sync/mpsc/bounded/array.rs b/ylong_runtime/src/sync/mpsc/bounded/array.rs index 872969a..feba4e4 100644 --- a/ylong_runtime/src/sync/mpsc/bounded/array.rs +++ b/ylong_runtime/src/sync/mpsc/bounded/array.rs @@ -87,7 +87,7 @@ impl Array { // Compare the index of the node with the tail to avoid senders in different // cycles writing data to the same point at the same time. if (tail >> INDEX_SHIFT) == node_index { - match self.tail.compare_exchange( + match self.tail.compare_exchange_weak( tail, tail.wrapping_add(1 << INDEX_SHIFT), AcqRel, diff --git a/ylong_runtime/src/sync/mpsc/unbounded/queue.rs b/ylong_runtime/src/sync/mpsc/unbounded/queue.rs index e44c122..a21f369 100644 --- a/ylong_runtime/src/sync/mpsc/unbounded/queue.rs +++ b/ylong_runtime/src/sync/mpsc/unbounded/queue.rs @@ -168,7 +168,7 @@ impl Queue { match self .tail .index - .compare_exchange(tail, tail + (1 << INDEX_SHIFT), AcqRel, Acquire) + .compare_exchange_weak(tail, tail + (1 << INDEX_SHIFT), AcqRel, Acquire) { Ok(_) => { self.send_inner(index, block, new_block, value); diff --git a/ylong_runtime/src/sync/oneshot.rs b/ylong_runtime/src/sync/oneshot.rs index f84c378..5700afb 100644 --- a/ylong_runtime/src/sync/oneshot.rs +++ b/ylong_runtime/src/sync/oneshot.rs @@ -171,7 +171,7 @@ impl Sender { if self .channel .state - .compare_exchange(INIT, SENT, AcqRel, Acquire) + .compare_exchange_weak(INIT, SENT, AcqRel, Acquire) .is_ok() { self.channel.waker.wake(); diff --git a/ylong_runtime/src/sync/rwlock.rs b/ylong_runtime/src/sync/rwlock.rs index 658849f..4d0212a 100644 --- a/ylong_runtime/src/sync/rwlock.rs +++ b/ylong_runtime/src/sync/rwlock.rs @@ -141,7 +141,7 @@ impl RwLock { } match self .read_count - .compare_exchange(read_count, read_count + 1, AcqRel, Acquire) + .compare_exchange_weak(read_count, read_count + 1, AcqRel, Acquire) { Ok(_) => return Ok(RwLockReadGuard(self)), Err(curr) => read_count = curr, -- Gitee