Skip to content

Commit 38908e9

Browse files
authored
[GCChecker] add a few more know functions to lock list (JuliaLang#56573)
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.
1 parent 83ef112 commit 38908e9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/clangsa/GCChecker.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -779,21 +779,27 @@ bool GCChecker::isFDAnnotatedNotSafepoint(const clang::FunctionDecl *FD, const S
779779

780780
static bool isMutexLock(StringRef name) {
781781
return name == "uv_mutex_lock" ||
782-
//name == "uv_mutex_trylock" ||
782+
name == "uv_mutex_trylock" ||
783783
name == "pthread_mutex_lock" ||
784-
//name == "pthread_mutex_trylock" ||
784+
name == "pthread_mutex_trylock" ||
785+
name == "__gthread_mutex_lock" ||
786+
name == "__gthread_mutex_trylock" ||
787+
name == "__gthread_recursive_mutex_lock" ||
788+
name == "__gthread_recursive_mutex_trylock" ||
785789
name == "pthread_spin_lock" ||
786-
//name == "pthread_spin_trylock" ||
790+
name == "pthread_spin_trylock" ||
787791
name == "uv_rwlock_rdlock" ||
788-
//name == "uv_rwlock_tryrdlock" ||
792+
name == "uv_rwlock_tryrdlock" ||
789793
name == "uv_rwlock_wrlock" ||
790-
//name == "uv_rwlock_trywrlock" ||
794+
name == "uv_rwlock_trywrlock" ||
791795
false;
792796
}
793797

794798
static bool isMutexUnlock(StringRef name) {
795799
return name == "uv_mutex_unlock" ||
796800
name == "pthread_mutex_unlock" ||
801+
name == "__gthread_mutex_unlock" ||
802+
name == "__gthread_recursive_mutex_unlock" ||
797803
name == "pthread_spin_unlock" ||
798804
name == "uv_rwlock_rdunlock" ||
799805
name == "uv_rwlock_wrunlock" ||

0 commit comments

Comments
 (0)