summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alkondratenko@gmail.com>2017-04-29 16:46:21 -0700
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2017-05-14 19:04:55 -0700
commit491b1aca7edbbaed9ea6f7baaa547a35cf385130 (patch)
treeeb68aabc87de2134d1acb634a2c818e0ec2b89ef
parent691045b95761bedb9170d758be82f9b2f15c673a (diff)
downloadgperftools-491b1aca7edbbaed9ea6f7baaa547a35cf385130.tar.gz
don't try to use pthread_atfork on windows
-rw-r--r--src/maybe_threads.cc6
-rw-r--r--src/windows/mingw.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/maybe_threads.cc b/src/maybe_threads.cc
index acfc99a..ef7e582 100644
--- a/src/maybe_threads.cc
+++ b/src/maybe_threads.cc
@@ -69,10 +69,12 @@ extern "C" {
__THROW ATTRIBUTE_WEAK;
int pthread_once(pthread_once_t *, void (*)(void))
ATTRIBUTE_WEAK;
+#ifdef HAVE_FORK
int pthread_atfork(void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void))
__THROW ATTRIBUTE_WEAK;
+#endif
}
#define MAX_PERTHREAD_VALS 16
@@ -161,6 +163,8 @@ int perftools_pthread_once(pthread_once_t *ctl,
}
}
+#ifdef HAVE_FORK
+
void perftools_pthread_atfork(void (*before)(),
void (*parent_after)(),
void (*child_after)()) {
@@ -169,3 +173,5 @@ void perftools_pthread_atfork(void (*before)(),
CHECK(rv == 0);
}
}
+
+#endif
diff --git a/src/windows/mingw.h b/src/windows/mingw.h
index 0586e62..c91a313 100644
--- a/src/windows/mingw.h
+++ b/src/windows/mingw.h
@@ -63,6 +63,8 @@
#undef HAVE_PTHREAD
#endif
+#undef HAVE_FORK
+
#define HAVE_PID_T
#include "windows/port.h"