Move background thread creation to background_thread_0.

To avoid complications, avoid invoking pthread_create "internally", instead rely
on thread0 to launch new threads, and also terminating threads when asked.
This commit is contained in:
Qi Wang 2017-06-08 22:46:31 -07:00 committed by Qi Wang
parent 13685ab1b7
commit 464cb60490
4 changed files with 313 additions and 208 deletions

View file

@ -18,6 +18,8 @@ struct background_thread_info_s {
malloc_mutex_t mtx;
/* Whether the thread has been created. */
bool started;
/* Pause execution (for arena reset / destroy). */
bool pause;
/* When true, it means no wakeup scheduled. */
atomic_b_t indefinite_sleep;
/* Next scheduled wakeup time (absolute time in ns). */