tsan: fix false positive in pthread stack manupulation

pthread uses internal cache, we do not see synchronization in it

llvm-svn: 197982
This commit is contained in:
Dmitry Vyukov 2013-12-24 14:38:12 +00:00
parent 64c9548d66
commit 6971fef2f9
1 changed files with 4 additions and 0 deletions

View File

@ -880,7 +880,9 @@ TSAN_INTERCEPTOR(int, pthread_create,
{
// Otherwise we see false positives in pthread stack manipulation.
ScopedIgnoreInterceptors ignore;
ThreadIgnoreBegin(thr, pc);
res = REAL(pthread_create)(th, attr, __tsan_thread_start_func, &p);
ThreadIgnoreEnd(thr, pc);
}
if (res == 0) {
int tid = ThreadCreate(thr, pc, *(uptr*)th, detached);
@ -897,7 +899,9 @@ TSAN_INTERCEPTOR(int, pthread_create,
TSAN_INTERCEPTOR(int, pthread_join, void *th, void **ret) {
SCOPED_INTERCEPTOR_RAW(pthread_join, th, ret);
int tid = ThreadTid(thr, pc, (uptr)th);
ThreadIgnoreBegin(thr, pc);
int res = BLOCK_REAL(pthread_join)(th, ret);
ThreadIgnoreEnd(thr, pc);
if (res == 0) {
ThreadJoin(thr, pc, tid);
}