From d6dda4f202cd4de6702f2b3ba500baf03a2d01c6 Mon Sep 17 00:00:00 2001 From: lixianjing Date: Tue, 19 Nov 2024 16:22:18 +0800 Subject: [PATCH] improve atomic.h --- docs/changes.md | 1 + src/tkc/atomic.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/changes.md b/docs/changes.md index 11556ad79..64f2114a1 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -3,6 +3,7 @@ 2024/11/19 * 增加函数 str_append_format_padding * 增加 atomic_compare_exchange(感谢兆坤提供补丁) + * 完善 atomic(感谢兆坤提供补丁) 2024/11/18 * 完善 atomic(感谢兆坤提供补丁) diff --git a/src/tkc/atomic.h b/src/tkc/atomic.h index 04a76ecad..a2e5e4ab6 100644 --- a/src/tkc/atomic.h +++ b/src/tkc/atomic.h @@ -308,7 +308,7 @@ static bool_t tk_atomic_compare_exchange_strong(tk_atomic_t* atomic, value_t* ex default: { /* tk_atomic_support_value_type() 已经判断过了,正常不可能会跑到这里 */ assert(!"Not support type!"); - return RET_BAD_PARAMS; + return FALSE; } break; } @@ -696,7 +696,7 @@ static bool_t tk_atomic_compare_exchange_weak(tk_atomic_t* atomic, value_t* expe default: { /* tk_atomic_support_value_type() 已经判断过了,正常不可能会跑到这里 */ assert(!"Not support type!"); - return RET_BAD_PARAMS; + return FALSE; } break; } @@ -757,7 +757,7 @@ static bool_t tk_atomic_compare_exchange_strong(tk_atomic_t* atomic, value_t* ex default: { /* tk_atomic_support_value_type() 已经判断过了,正常不可能会跑到这里 */ assert(!"Not support type!"); - return RET_BAD_PARAMS; + return FALSE; } break; }