From: Scott Sanders Date: Fri, 18 Nov 2011 16:11:35 +0000 (-0500) Subject: Add patch from jimmyattime (issue #8) X-Git-Tag: collectd-5.1.0~35^2~25^2~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b2c7ba100aabd35751e379561773878013f31e04;p=collectd.git 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. --- 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");