X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fstatsd.c;h=1819b3ea21437e28ee0d505b941e84243ffbdd76;hb=95dcf60c822e4ab92c0dd1a7ff6cba73bc55bcd1;hp=5b7a6f182e7cef26af41b8db2baeb26c55f95b47;hpb=57702145cd9ed22b910574452098d63f4e3d2c4a;p=collectd.git diff --git a/src/statsd.c b/src/statsd.c index 5b7a6f18..1819b3ea 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -32,8 +32,6 @@ #include "utils_complain.h" #include "utils_latency.h" -#include - #include #include #include @@ -955,8 +953,6 @@ static int statsd_shutdown (void) /* {{{ */ void *key; void *value; - pthread_mutex_lock (&metrics_lock); - if (network_thread_running) { network_thread_shutdown = 1; @@ -965,6 +961,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);