[PATCH] D36385: [asan] Refactor thread creation bookkeeping

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 11:31:54 PDT 2017

mcgrathr added inline comments.

Comment at: compiler-rt/trunk/lib/asan/asan_thread.cc:277
+  SetCurrentThread(main_thread);
+  main_thread->ThreadStart(internal_getpid(),
+                           /* signal_thread_is_registered */ nullptr);
krytarowski wrote:
> Does it mean that there is assumption that process id = thread it?
Note this code is just moved around by this change (was in asan_rtl.cc), not introduced.  The logic using internal_getpid() here (and earlier GetPid()) goes back many years.

On Linux it is the case that the TID of the initial thread is the same as the PID, and this code does seem to assume that.



More information about the llvm-commits mailing list