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;
#else
int32_t code = pthread_mutex_trylock(mutex);
if (code) {
terrno = TAOS_SYSTEM_ERROR(code);
return terrno;
if (code && code != EBUSY) {
code = TAOS_SYSTEM_ERROR(code);
}
return code;
#endif
@ -816,9 +815,8 @@ int32_t taosThreadSpinTrylock(TdThreadSpinlock *lock) {
return pthread_mutex_trylock((pthread_mutex_t *)lock);
#else
int32_t code = pthread_spin_trylock((pthread_spinlock_t *)lock);
if (code) {
terrno = TAOS_SYSTEM_ERROR(code);
return code;
if (code && code != EBUSY) {
code = TAOS_SYSTEM_ERROR(code);
}
return code;
#endif