forked from OSchip/llvm-project
Revert "[tsan] Add pthread_cond_clockwait interceptor"
This reverts commit 16eb853ffd
.
The test is failing on some Linux build bots. See the review for
an example.
This commit is contained in:
parent
c6c8d4a13e
commit
87369c6261
|
@ -1202,21 +1202,6 @@ INTERCEPTOR(int, pthread_cond_timedwait, void *c, void *m, void *abstime) {
|
|||
m);
|
||||
}
|
||||
|
||||
#if SANITIZER_LINUX
|
||||
INTERCEPTOR(int, pthread_cond_clockwait, void *c, void *m,
|
||||
__sanitizer_clockid_t clock, void *abstime) {
|
||||
void *cond = init_cond(c);
|
||||
SCOPED_TSAN_INTERCEPTOR(pthread_cond_clockwait, cond, m, clock, abstime);
|
||||
return cond_wait(
|
||||
thr, pc, &si,
|
||||
[=]() { return REAL(pthread_cond_clockwait)(cond, m, clock, abstime); },
|
||||
cond, m);
|
||||
}
|
||||
#define TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT TSAN_INTERCEPT(pthread_cond_clockwait)
|
||||
#else
|
||||
#define TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT
|
||||
#endif
|
||||
|
||||
#if SANITIZER_MAC
|
||||
INTERCEPTOR(int, pthread_cond_timedwait_relative_np, void *c, void *m,
|
||||
void *reltime) {
|
||||
|
@ -2731,8 +2716,6 @@ void InitializeInterceptors() {
|
|||
TSAN_INTERCEPT_VER(pthread_cond_timedwait, PTHREAD_ABI_BASE);
|
||||
TSAN_INTERCEPT_VER(pthread_cond_destroy, PTHREAD_ABI_BASE);
|
||||
|
||||
TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT;
|
||||
|
||||
TSAN_INTERCEPT(pthread_mutex_init);
|
||||
TSAN_INTERCEPT(pthread_mutex_destroy);
|
||||
TSAN_INTERCEPT(pthread_mutex_trylock);
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
// Regression test for https://github.com/google/sanitizers/issues/1259
|
||||
// RUN: %clang_tsan -O1 %s -o %t && %run %t
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <pthread.h>
|
||||
|
||||
pthread_cond_t cv;
|
||||
pthread_mutex_t mtx;
|
||||
|
||||
void *fn(void *vp) {
|
||||
pthread_mutex_lock(&mtx);
|
||||
pthread_cond_signal(&cv);
|
||||
pthread_mutex_unlock(&mtx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int main() {
|
||||
pthread_mutex_lock(&mtx);
|
||||
|
||||
pthread_t tid;
|
||||
pthread_create(&tid, NULL, fn, NULL);
|
||||
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
ts.tv_sec += 10;
|
||||
pthread_cond_clockwait(&cv, &mtx, CLOCK_MONOTONIC, &ts);
|
||||
pthread_mutex_unlock(&mtx);
|
||||
|
||||
pthread_join(tid, NULL);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue