diff options
author | Tomas Korbar <tkorbar@redhat.com> | 2020-05-20 15:28:10 +0200 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2020-05-27 15:11:01 -0700 |
commit | cdeb988c28ca44d02e14c94467331af614cb976f (patch) | |
tree | fd57c629ad7c7cddb22d767dc636cf93e33d9b44 /thread.c | |
parent | df1315225a6273b66f4d2aaecd8197ea44627600 (diff) | |
download | memcached-cdeb988c28ca44d02e14c94467331af614cb976f.tar.gz |
Do not join lru and slab maintainer threads if they do not exist
If no_modern option was supplied then these threads did not run
but memcached still attempted to join them, which resulted in a
segfault.
resolve #685
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -226,12 +226,16 @@ void stop_threads(void) { stop_item_crawler_thread(CRAWLER_WAIT); if (settings.verbose > 0) fprintf(stderr, "stopped lru crawler\n"); - stop_lru_maintainer_thread(); - if (settings.verbose > 0) - fprintf(stderr, "stopped maintainer\n"); - stop_slab_maintenance_thread(); - if (settings.verbose > 0) - fprintf(stderr, "stopped slab mover\n"); + if (settings.lru_maintainer_thread) { + stop_lru_maintainer_thread(); + if (settings.verbose > 0) + fprintf(stderr, "stopped maintainer\n"); + } + if (settings.slab_reassign) { + stop_slab_maintenance_thread(); + if (settings.verbose > 0) + fprintf(stderr, "stopped slab mover\n"); + } logger_stop(); if (settings.verbose > 0) fprintf(stderr, "stopped logger thread\n"); |