[PATCH] D31883: Don't assume PTHREAD_CREATE_JOINABLE is 0 on all systems
Aleksey Shlyapnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 13 10:25:43 PDT 2017
alekseyshl added inline comments.
================
Comment at: lib/lsan/lsan_interceptors.cc:289
+ int tid = ThreadCreate(GetCurrentThread(), *(uptr *)th,
+ IsStateDetached(detached));
CHECK_NE(tid, 0);
----------------
fjricci wrote:
> alekseyshl wrote:
> > fjricci wrote:
> > > alekseyshl wrote:
> > > > What about !SANITIZER_POSIX case? Who's going to provide this function?
> > > Lots of other things in this function will also break in the !SANITIZER_POSIX case - pthread_attr_getdetachstate, pthread_create, etc. I don't think this file is currently designed to work at all in non-posix cases.
> > Let's remove #if SANITIZER_POSIX around include then, it's misleading.
> >
> > What about tsan_interceptors.cc? Is it also posix only?
> Yeah, tsan is also posix only, and there is definitely quite a bit of posix-specific code in that file. Interestingly, they do use the SANITIZER_POSIX guard on the header inclusion in that file, perhaps for future-proofing?
I don't know why. It's trivial to add back and in case of future changes, the failure is more explicit when there's no ifdef around the include.
https://reviews.llvm.org/D31883
More information about the llvm-commits
mailing list