Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: third_party/tcmalloc/chromium/src/profile-handler.h

Issue 9416072: Fix gperftools to not arm the profiling timer by default. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/profile-handler.h
diff --git a/third_party/tcmalloc/chromium/src/profile-handler.h b/third_party/tcmalloc/chromium/src/profile-handler.h
index 4b078ecf59ed021045b5c4b27308322b7381a7e0..cc50dbb42b1cf5c84ecbe344dd12eca343caf412 100644
--- a/third_party/tcmalloc/chromium/src/profile-handler.h
+++ b/third_party/tcmalloc/chromium/src/profile-handler.h
@@ -102,6 +102,18 @@ typedef void (*ProfileHandlerCallback)(int sig, siginfo_t* sig_info,
void ProfileHandlerRegisterThread();
/*
+ * Unregisters a thread before exiting. This is not strictly necessary in most
+ * cases, because the pthread library will detect that previously-valid thread
+ * identifiers have become invalid. For dead-thread detection to work, pthread
+ * identifiers are accessed even after the thread has been destroyed, which may
+ * fail in some edge cases (thread ID recycling) and even crash in exotic cases
+ * (for example, when using user-allocated stacks with NPTL and unmapping the
+ * memory after the thread terminates). Thus, it is generally good practice to
+ * call ProfileHandlerUnregisterThread() just before exiting the thread.
+ */
+void ProfileHandlerUnregisterThread();
+
+/*
* Registers a callback routine. This callback function will be called in the
* context of SIGPROF handler, so must be async-signal-safe. The returned token
* is to be used when unregistering this callback via
« no previous file with comments | « third_party/tcmalloc/chromium/src/gperftools/profiler.h ('k') | third_party/tcmalloc/chromium/src/profile-handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698