From b2c7ba100aabd35751e379561773878013f31e04 Mon Sep 17 00:00:00 2001 From: Scott Sanders Date: Fri, 18 Nov 2011 11:11:35 -0500 Subject: [PATCH] Add patch from jimmyattime (issue #8) This is certainly no worse than the previous usage of pthread_mutex_lock, and will prevent the plugin from blocking. I'd like to add better handling of failed locks in future commits. --- src/write_graphite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_graphite.c b/src/write_graphite.c index 57933e8d..8b5afb81 100644 --- a/src/write_graphite.c +++ b/src/write_graphite.c @@ -108,7 +108,7 @@ static int wg_send_buffer (struct wg_callback *cb) status, strerror (errno)); - pthread_mutex_lock (&cb->send_lock); + pthread_mutex_trylock (&cb->send_lock); DEBUG ("write_graphite plugin: closing socket and restting fd " "so reinit will occur"); -- 2.30.2