X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.c;h=84a5abf240bba3226c450afda0a23e38931711f1;hb=dd28a7dbb9404672d850063f3e58ee8dc6debb20;hp=5ff21c668d4637ed2720d6a13dbdcd56d7439d6e;hpb=09e1bfaed8475b7f81befe8581fb09711795b13b;p=collectd.git diff --git a/src/plugin.c b/src/plugin.c index 5ff21c66..84a5abf2 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -379,12 +379,15 @@ static void *plugin_read_thread (void __attribute__((unused)) *args) * we need to re-evaluate the condition every time * pthread_cond_timedwait returns. */ rc = 0; - while (!timeout_reached(rf->rf_next_read) && rc == 0) { + while ((read_loop != 0) + && !timeout_reached(rf->rf_next_read) + && rc == 0) + { rc = pthread_cond_timedwait (&read_cond, &read_lock, &rf->rf_next_read); } - /* Must hold `real_lock' when accessing `rf->rf_type'. */ + /* Must hold `read_lock' when accessing `rf->rf_type'. */ rf_type = rf->rf_type; pthread_mutex_unlock (&read_lock);