projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
varnish plugin: Add informative warnings to the config handling.
[collectd.git]
/
src
/
statsd.c
diff --git
a/src/statsd.c
b/src/statsd.c
index
5b7a6f1
..
a0c6e4f
100644
(file)
--- a/
src/statsd.c
+++ b/
src/statsd.c
@@
-29,11
+29,8
@@
#include "common.h"
#include "configfile.h"
#include "utils_avltree.h"
#include "common.h"
#include "configfile.h"
#include "utils_avltree.h"
-#include "utils_complain.h"
#include "utils_latency.h"
#include "utils_latency.h"
-#include <pthread.h>
-
#include <sys/types.h>
#include <netdb.h>
#include <poll.h>
#include <sys/types.h>
#include <netdb.h>
#include <poll.h>
@@
-358,7
+355,7
@@
static int statsd_handle_set (char const *name, /* {{{ */
/* Make sure metric->set exists. */
if (metric->set == NULL)
/* Make sure metric->set exists. */
if (metric->set == NULL)
- metric->set = c_avl_create ((
void *
) strcmp);
+ metric->set = c_avl_create ((
int (*) (const void *, const void *)
) strcmp);
if (metric->set == NULL)
{
if (metric->set == NULL)
{
@@
-712,7
+709,7
@@
static int statsd_init (void) /* {{{ */
{
pthread_mutex_lock (&metrics_lock);
if (metrics_tree == NULL)
{
pthread_mutex_lock (&metrics_lock);
if (metrics_tree == NULL)
- metrics_tree = c_avl_create ((
void *
) strcmp);
+ metrics_tree = c_avl_create ((
int (*) (const void *, const void *)
) strcmp);
if (!network_thread_running)
{
if (!network_thread_running)
{
@@
-955,8
+952,6
@@
static int statsd_shutdown (void) /* {{{ */
void *key;
void *value;
void *key;
void *value;
- pthread_mutex_lock (&metrics_lock);
-
if (network_thread_running)
{
network_thread_shutdown = 1;
if (network_thread_running)
{
network_thread_shutdown = 1;
@@
-965,6
+960,8
@@
static int statsd_shutdown (void) /* {{{ */
}
network_thread_running = 0;
}
network_thread_running = 0;
+ pthread_mutex_lock (&metrics_lock);
+
while (c_avl_pick (metrics_tree, &key, &value) == 0)
{
sfree (key);
while (c_avl_pick (metrics_tree, &key, &value) == 0)
{
sfree (key);