This patch makes SuspendedThreadsList a template parameterized by the thread ID type, so that different platforms (e.g. Linux and OSX) can share the implementation. The SuspendedThreadsRegisters interface is extracted to keep existing code that uses SuspendedThreadsList platform-agnostic.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
What does this patch do that couldn't be achieved with the following change:
diff --git a/lib/sanitizer_common/sanitizer_stoptheworld.h b/lib/sanitizer_common/sanitizer_stoptheworld.h
index a326467..46619c9 100644
- a/lib/sanitizer_common/sanitizer_stoptheworld.h
+++ b/lib/sanitizer_common/sanitizer_stoptheworld.h
@@ -18,7 +18,11 @@
#include "sanitizer_common.h"
namespace __sanitizer {
+#if SANITIZER_LINUX
typedef int SuspendedThreadID;
+#elif SANITIZER_MAC
+typedef macos_thread_t SuspendedThreadID;
+#endif
Holds the list of suspended threads and provides an interface to dump their
register contexts.