MCPcopy Create free account
hub / github.com/beefytech/Beef / pthread_create_fptr_init

Function pthread_create_fptr_init

BeefRT/JEMalloc/src/background_thread.c:713–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711#endif
712
713static bool
714pthread_create_fptr_init(void) {
715 if (pthread_create_fptr != NULL) {
716 return false;
717 }
718 /*
719 * Try the next symbol first, because 1) when use lazy_lock we have a
720 * wrapper for pthread_create; and 2) application may define its own
721 * wrapper as well (and can call malloc within the wrapper).
722 */
723#ifdef JEMALLOC_HAVE_DLSYM
724 pthread_create_fptr = dlsym(RTLD_NEXT, "pthread_create");
725#else
726 pthread_create_fptr = NULL;
727#endif
728 if (pthread_create_fptr == NULL) {
729 if (config_lazy_lock) {
730 malloc_write("<jemalloc>: Error in dlsym(RTLD_NEXT, "
731 "\"pthread_create\")\n");
732 abort();
733 } else {
734 /* Fall back to the default symbol. */
735 pthread_create_fptr = pthread_create;
736 }
737 }
738
739 return false;
740}
741
742/*
743 * When lazy lock is enabled, we need to make sure setting isthreaded before

Callers 2

background_thread_boot0Function · 0.85

Calls 1

malloc_writeFunction · 0.85

Tested by

no test coverage detected