Merge pull request #27011 from taosdata/fix/TD-30698-3.0

fix: caused by error code change
This commit is contained in:
Hongze Cheng 2024-08-06 20:07:07 +08:00 committed by GitHub
commit 38cc18be18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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