Skip to content

Commit b8f4c73

Browse files
committed
Remove an incorrect assertion.
Background threads are created without holding the global background_thread lock, which mean paused state is possible (and fine).
1 parent dedfeec commit b8f4c73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/background_thread.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,10 @@ check_background_thread_creation(tsd_t *tsd, unsigned *n_created,
398398
}
399399
background_thread_info_t *info = &background_thread_info[i];
400400
malloc_mutex_lock(tsdn, &info->mtx);
401-
assert(info->state != background_thread_paused);
401+
/*
402+
* In case of the background_thread_paused state because of
403+
* arena reset, delay the creation.
404+
*/
402405
bool create = (info->state == background_thread_started);
403406
malloc_mutex_unlock(tsdn, &info->mtx);
404407
if (!create) {

0 commit comments

Comments
 (0)