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
This commit is contained in:
Dmitry Vyukov 2021-07-11 14:43:31 +02:00
parent fde34d9f89
commit 8bbf2f7a44
1 changed files with 1 additions and 1 deletions

View File

@ -6463,7 +6463,7 @@ INTERCEPTOR(int, sem_wait, __sanitizer_sem_t *s) {
INTERCEPTOR(int, sem_trywait, __sanitizer_sem_t *s) { INTERCEPTOR(int, sem_trywait, __sanitizer_sem_t *s) {
void *ctx; void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, sem_trywait, s); 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) { if (res == 0) {
COMMON_INTERCEPTOR_ACQUIRE(ctx, (uptr)s); COMMON_INTERCEPTOR_ACQUIRE(ctx, (uptr)s);
} }