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

Unified Diff: third_party/tcmalloc/chromium/src/maybe_threads.cc

Issue 1715903002: Adapt upstream patches fixing potential deadlock in tcmalloc after fork. Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Updated README Created 4 years, 10 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
« no previous file with comments | « third_party/tcmalloc/chromium/src/maybe_threads.h ('k') | third_party/tcmalloc/chromium/src/static_vars.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/maybe_threads.cc
diff --git a/third_party/tcmalloc/chromium/src/maybe_threads.cc b/third_party/tcmalloc/chromium/src/maybe_threads.cc
index 80a07402e908d52383665ebb9d4279246d1eb320..f08ecb070cfeebf9b68f9f44e975f72e0f2d28a3 100644
--- a/third_party/tcmalloc/chromium/src/maybe_threads.cc
+++ b/third_party/tcmalloc/chromium/src/maybe_threads.cc
@@ -47,6 +47,7 @@
#include <string>
#include "maybe_threads.h"
#include "base/basictypes.h"
+#include "base/logging.h"
// __THROW is defined in glibc systems. It means, counter-intuitively,
// "This function will never throw an exception." It's an optional
@@ -65,6 +66,10 @@ extern "C" {
__THROW ATTRIBUTE_WEAK;
int pthread_once(pthread_once_t *, void (*)(void))
ATTRIBUTE_WEAK;
+ int pthread_atfork(void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void))
+ __THROW ATTRIBUTE_WEAK;
}
#define MAX_PERTHREAD_VALS 16
@@ -135,3 +140,12 @@ int perftools_pthread_once(pthread_once_t *ctl,
}
#endif
}
+
+void perftools_pthread_atfork(void (*before)(),
+ void (*parent_after)(),
+ void (*child_after)()) {
+ if (pthread_atfork) {
+ int rv = pthread_atfork(before, parent_after, child_after);
+ CHECK(rv == 0);
+ }
+}
« no previous file with comments | « third_party/tcmalloc/chromium/src/maybe_threads.h ('k') | third_party/tcmalloc/chromium/src/static_vars.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698