diff --git a/ylong_runtime/src/executor/queue.rs b/ylong_runtime/src/executor/queue.rs index 99dacc260e61dfb628785184ab8e426697be6059..b77c8e89c2bb70c65c7839ab4f19bdcfc79b39ad 100644 --- a/ylong_runtime/src/executor/queue.rs +++ b/ylong_runtime/src/executor/queue.rs @@ -216,7 +216,7 @@ impl InnerBuffer { let res = self .front - .compare_exchange_weak(head, next, AcqRel, Acquire); + .compare_exchange(head, next, AcqRel, Acquire); match res { Ok(_) => break real_pos, Err(actual) => head = actual, @@ -368,7 +368,7 @@ impl InnerBuffer { let res = self.front - .compare_exchange_weak(src_prev_front, src_next_front, AcqRel, Acquire); + .compare_exchange(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 db59949db314e544eedb39f624cbceae60f4e280..9e44236d5bd9f67e71a35836d1eb921e913d6e43 100644 --- a/ylong_runtime/src/sync/mpsc/bounded/array.rs +++ b/ylong_runtime/src/sync/mpsc/bounded/array.rs @@ -86,7 +86,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_weak( + match self.tail.compare_exchange( 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 9507fb058f4c432b1921ccba8c7d78ac3d0f7612..4b0c8da4f12864f0881c628db86d9dbde44b8a4b 100644 --- a/ylong_runtime/src/sync/mpsc/unbounded/queue.rs +++ b/ylong_runtime/src/sync/mpsc/unbounded/queue.rs @@ -138,7 +138,7 @@ impl Queue { if index + 1 == CAPACITY && new_block.is_none() { new_block = Some(Box::new(Block::::new())); } - match self.tail.index.compare_exchange_weak( + match self.tail.index.compare_exchange( tail, tail + (1 << INDEX_SHIFT), AcqRel, diff --git a/ylong_runtime/src/sync/oneshot.rs b/ylong_runtime/src/sync/oneshot.rs index 5700afbf84176e9c289706819342091296944121..f84c378480d888d03addd6231d5153c2a2d7cacc 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_weak(INIT, SENT, AcqRel, Acquire) + .compare_exchange(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 ec09bdbe12ef61975741da4518499da21435fbbb..a2ee6926540833ab3dc6c0b65bf8554a6a177b28 100644 --- a/ylong_runtime/src/sync/rwlock.rs +++ b/ylong_runtime/src/sync/rwlock.rs @@ -138,7 +138,7 @@ impl RwLock { if read_count < 0 { return Err(LockError); } else { - match self.read_count.compare_exchange_weak( + match self.read_count.compare_exchange( read_count, read_count + 1, AcqRel,