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

Function background_threads_disable

BeefRT/JEMalloc/src/background_thread.c:573–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571}
572
573bool
574background_threads_disable(tsd_t *tsd) {
575 assert(!background_thread_enabled());
576 malloc_mutex_assert_owner(tsd_tsdn(tsd), &background_thread_lock);
577
578 /* Thread 0 will be responsible for terminating other threads. */
579 if (background_threads_disable_single(tsd,
580 &background_thread_info[0])) {
581 return true;
582 }
583 assert(n_background_threads == 0);
584 unsigned narenas = narenas_total_get();
585 for (unsigned i = 0; i < narenas; i++) {
586 arena_t *arena = arena_get(tsd_tsdn(tsd), i, false);
587 if (arena != NULL) {
588 pa_shard_set_deferral_allowed(tsd_tsdn(tsd),
589 &arena->pa_shard, false);
590 }
591 }
592
593 return false;
594}
595
596bool
597background_thread_is_started(background_thread_info_t *info) {

Callers 3

ctl.cFile · 0.85

Calls 7

tsd_tsdnFunction · 0.85
narenas_total_getFunction · 0.85
arena_getFunction · 0.85

Tested by

no test coverage detected