[PATCH] D72115: [TSan] Remove side effects from ThreadTid

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 15:45:26 PST 2020


yln created this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

`ThreadTid` and `FindThreadByUid` should free of side effects.
Currently, two consecutive calls to ThreadTid with the same arguments
return different results.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72115

Files:
  compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp


Index: compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
===================================================================
--- compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
+++ compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
@@ -288,7 +288,6 @@
 static bool FindThreadByUid(ThreadContextBase *tctx, void *arg) {
   uptr uid = (uptr)arg;
   if (tctx->user_id == uid && tctx->status != ThreadStatusInvalid) {
-    tctx->user_id = 0;
     return true;
   }
   return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72115.235961.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200102/924a5d8d/attachment.bin>


More information about the llvm-commits mailing list