X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fstatsd.c;h=54b6e943618d8f65b19c1a538a0cdf6758442814;hb=2c7b491427fd84c9e24c9d41686a15ce42219a0b;hp=d12cb0d5b83d5677f0ba8125c7d29250e7db3353;hpb=b4cc5c7399adf79198aea816d44a42df25431d15;p=collectd.git diff --git a/src/statsd.c b/src/statsd.c index d12cb0d5..54b6e943 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -941,8 +941,6 @@ static int statsd_shutdown (void) /* {{{ */ void *key; void *value; - pthread_mutex_lock (&metrics_lock); - if (network_thread_running) { network_thread_shutdown = 1; @@ -951,6 +949,8 @@ static int statsd_shutdown (void) /* {{{ */ } network_thread_running = 0; + pthread_mutex_lock (&metrics_lock); + while (c_avl_pick (metrics_tree, &key, &value) == 0) { sfree (key);