projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
types_list.c: add header for prototypes
[collectd.git]
/
src
/
ping.c
diff --git
a/src/ping.c
b/src/ping.c
index
8bbb807
..
ecbbd9d
100644
(file)
--- a/
src/ping.c
+++ b/
src/ping.c
@@
-236,7
+236,7
@@
static int ping_dispatch_all (pingobj_t *pingobj) /* {{{ */
static void *ping_thread (void *arg) /* {{{ */
{
static void *ping_thread (void *arg) /* {{{ */
{
-
static
pingobj_t *pingobj = NULL;
+ pingobj_t *pingobj = NULL;
struct timeval tv_begin;
struct timeval tv_end;
struct timeval tv_begin;
struct timeval tv_end;
@@
-354,7
+354,7
@@
static void *ping_thread (void *arg) /* {{{ */
* `ts_wait'. */
time_calc (&ts_wait, &ts_int, &tv_begin, &tv_end);
* `ts_wait'. */
time_calc (&ts_wait, &ts_int, &tv_begin, &tv_end);
-
status =
pthread_cond_timedwait (&ping_cond, &ping_lock, &ts_wait);
+ pthread_cond_timedwait (&ping_cond, &ping_lock, &ts_wait);
if (ping_thread_loop <= 0)
break;
} /* while (ping_thread_loop > 0) */
if (ping_thread_loop <= 0)
break;
} /* while (ping_thread_loop > 0) */
@@
-416,8
+416,10
@@
static int stop_thread (void) /* {{{ */
status = -1;
}
status = -1;
}
+ pthread_mutex_lock (&ping_lock);
memset (&ping_thread_id, 0, sizeof (ping_thread_id));
ping_thread_error = 0;
memset (&ping_thread_id, 0, sizeof (ping_thread_id));
ping_thread_error = 0;
+ pthread_mutex_unlock (&ping_lock);
return (status);
} /* }}} int stop_thread */
return (status);
} /* }}} int stop_thread */