Skip to content

Commit

Permalink
[GCChecker] add a few more know functions to lock list
Browse files Browse the repository at this point in the history
I ran into issues with glibc locally without these being specified, and
seems like trylock just works too, though perhaps that is just a lack of
accuracy from the checker since we have very few of those.
  • Loading branch information
vtjnash committed Nov 15, 2024
1 parent caa2f7d commit 972dfff
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/clangsa/GCChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,21 +779,27 @@ bool GCChecker::isFDAnnotatedNotSafepoint(const clang::FunctionDecl *FD, const S

static bool isMutexLock(StringRef name) {
return name == "uv_mutex_lock" ||
//name == "uv_mutex_trylock" ||
name == "uv_mutex_trylock" ||
name == "pthread_mutex_lock" ||
//name == "pthread_mutex_trylock" ||
name == "pthread_mutex_trylock" ||
name == "__gthread_mutex_lock" ||
name == "__gthread_mutex_trylock" ||
name == "__gthread_recursive_mutex_lock" ||
name == "__gthread_recursive_mutex_trylock" ||
name == "pthread_spin_lock" ||
//name == "pthread_spin_trylock" ||
name == "pthread_spin_trylock" ||
name == "uv_rwlock_rdlock" ||
//name == "uv_rwlock_tryrdlock" ||
name == "uv_rwlock_tryrdlock" ||
name == "uv_rwlock_wrlock" ||
//name == "uv_rwlock_trywrlock" ||
name == "uv_rwlock_trywrlock" ||
false;
}

static bool isMutexUnlock(StringRef name) {
return name == "uv_mutex_unlock" ||
name == "pthread_mutex_unlock" ||
name == "__gthread_mutex_unlock" ||
name == "__gthread_recursive_mutex_unlock" ||
name == "pthread_spin_unlock" ||
name == "uv_rwlock_rdunlock" ||
name == "uv_rwlock_wrunlock" ||
Expand Down

0 comments on commit 972dfff

Please sign in to comment.