summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2018-03-30 22:09:05 (GMT)
committerQi Wang <interwq@gmail.com>2018-04-02 17:03:47 (GMT)
commit21eb0d15a6cfdaee3aa78f724838b503053d7f00 (patch)
tree814e91a833c4240bd38e03cff2b86d11ea686a0c /test/unit
parent956c4ad6b57318bc7b6cd02bf9bfeb45afc4e3e2 (diff)
downloadjemalloc-21eb0d15a6cfdaee3aa78f724838b503053d7f00.zip
jemalloc-21eb0d15a6cfdaee3aa78f724838b503053d7f00.tar.gz
jemalloc-21eb0d15a6cfdaee3aa78f724838b503053d7f00.tar.bz2
Fix a background_thread shutdown issue.
1) make sure background thread 0 is always created; and 2) fix synchronization between thread 0 and the control thread.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/background_thread_enable.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/unit/background_thread_enable.c b/test/unit/background_thread_enable.c
index 9bb5865..7e4f6ed 100644
--- a/test/unit/background_thread_enable.c
+++ b/test/unit/background_thread_enable.c
@@ -24,6 +24,9 @@ TEST_BEGIN(test_deferred) {
size_t sz_b = sizeof(bool);
assert_d_eq(mallctl("background_thread", NULL, NULL, &enable, sz_b), 0,
"Failed to enable background threads");
+ enable = false;
+ assert_d_eq(mallctl("background_thread", NULL, NULL, &enable, sz_b), 0,
+ "Failed to disable background threads");
}
TEST_END