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

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

Issue 9667026: Revert 126020 - Experiment for updating the tcmalloc chromium branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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/maybe_threads.cc
===================================================================
--- third_party/tcmalloc/chromium/src/maybe_threads.cc (revision 126022)
+++ 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 {
« no previous file with comments | « third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h ('k') | third_party/tcmalloc/chromium/src/memfs_malloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698