fix: caused by error code change

This commit is contained in:
Hongze Cheng 2024-08-06 16:48:05 +08:00
parent 2d57e77df8
commit 09cd3cffe7
1 changed files with 4 additions and 6 deletions

View File

@ -445,9 +445,8 @@ int32_t taosThreadMutexTryLock(TdThreadMutex *mutex) {
return EBUSY; return EBUSY;
#else #else
int32_t code = pthread_mutex_trylock(mutex); int32_t code = pthread_mutex_trylock(mutex);
if (code) { if (code && code != EBUSY) {
terrno = TAOS_SYSTEM_ERROR(code); code = TAOS_SYSTEM_ERROR(code);
return terrno;
} }
return code; return code;
#endif #endif
@ -816,9 +815,8 @@ int32_t taosThreadSpinTrylock(TdThreadSpinlock *lock) {
return pthread_mutex_trylock((pthread_mutex_t *)lock); return pthread_mutex_trylock((pthread_mutex_t *)lock);
#else #else
int32_t code = pthread_spin_trylock((pthread_spinlock_t *)lock); int32_t code = pthread_spin_trylock((pthread_spinlock_t *)lock);
if (code) { if (code && code != EBUSY) {
terrno = TAOS_SYSTEM_ERROR(code); code = TAOS_SYSTEM_ERROR(code);
return code;
} }
return code; return code;
#endif #endif