[compiler-rt] 8bbf2f7 - sanitizer_common: make sem_trywait as non-blocking

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 04:10:11 PDT 2021


Author: Dmitry Vyukov
Date: 2021-07-12T13:10:04+02:00
New Revision: 8bbf2f7a44f907d54ad39a98d166a17be61dd66f

URL: https://github.com/llvm/llvm-project/commit/8bbf2f7a44f907d54ad39a98d166a17be61dd66f
DIFF: https://github.com/llvm/llvm-project/commit/8bbf2f7a44f907d54ad39a98d166a17be61dd66f.diff

LOG: sanitizer_common: make sem_trywait as non-blocking

sem_trywait never blocks.
Use REAL instead of COMMON_INTERCEPTOR_BLOCK_REAL.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D105775

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 7867fccde390..1145c2e09678 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -6463,7 +6463,7 @@ INTERCEPTOR(int, sem_wait, __sanitizer_sem_t *s) {
 INTERCEPTOR(int, sem_trywait, __sanitizer_sem_t *s) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, sem_trywait, s);
-  int res = COMMON_INTERCEPTOR_BLOCK_REAL(sem_trywait)(s);
+  int res = REAL(sem_trywait)(s);
   if (res == 0) {
     COMMON_INTERCEPTOR_ACQUIRE(ctx, (uptr)s);
   }


        


More information about the llvm-commits mailing list