#include "asan_suppressions.h"
#include "asan_thread.h"
#include "lsan/lsan_common.h"
+#include "sanitizer_common/sanitizer_internal_defs.h"
#include "sanitizer_common/sanitizer_libc.h"
// There is no general interception at all on Fuchsia.
}
INTERCEPTOR(int, pthread_exit, void *retval) {
- asanThreadArgRetval().Finish(GetThreadSelf(), retval);
+ AsanThread *t = GetCurrentThread();
+ if (t && t->tid() != kMainTid)
+ asanThreadArgRetval().Finish(GetThreadSelf(), retval);
return REAL(pthread_exit)(retval);
}
}
INTERCEPTOR(int, pthread_exit, void *retval) {
- GetThreadArgRetval().Finish(GetThreadSelf(), retval);
+ ThreadContextLsanBase *t = GetCurrentThread();
+ if (t && t->tid != kMainTid)
+ GetThreadArgRetval().Finish(GetThreadSelf(), retval);
return REAL(pthread_exit)(retval);
}