Index: third_party/tcmalloc/chromium/src/maybe_threads.cc |
=================================================================== |
--- third_party/tcmalloc/chromium/src/maybe_threads.cc (revision 124832) |
+++ third_party/tcmalloc/chromium/src/maybe_threads.cc (working copy) |
@@ -39,7 +39,6 @@ |
#include "config.h" |
#include <assert.h> |
#include <string.h> // for memcmp |
-#include <stdio.h> // for __isthreaded on FreeBSD |
// We don't actually need strings. But including this header seems to |
// stop the compiler trying to short-circuit our pthreads existence |
// tests and claiming that the address of a function is always |
@@ -99,28 +98,9 @@ |
} |
} |
- |
static pthread_once_t pthread_once_init = PTHREAD_ONCE_INIT; |
int perftools_pthread_once(pthread_once_t *ctl, |
void (*init_routine) (void)) { |
-#ifdef __FreeBSD__ |
- // On __FreeBSD__, calling pthread_once on a system that is not |
- // linked with -pthread is silently a noop. :-( Luckily, we have a |
- // workaround: FreeBSD exposes __isthreaded in <stdio.h>, which is |
- // set to 1 when the first thread is spawned. So on those systems, |
- // we can use our own separate pthreads-once mechanism, which is |
- // used until __isthreaded is 1 (which will never be true if the app |
- // is not linked with -pthread). |
- static bool pthread_once_ran_before_threads = false; |
- if (pthread_once_ran_before_threads) { |
- return 0; |
- } |
- if (!__isthreaded) { |
- init_routine(); |
- pthread_once_ran_before_threads = true; |
- return 0; |
- } |
-#endif |
if (pthread_once) { |
return pthread_once(ctl, init_routine); |
} else { |