mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added missing timer_delete()
This commit is contained in:
parent
b89f65debc
commit
b3d1fc8c45
2 changed files with 8 additions and 4 deletions
|
@ -58,6 +58,8 @@ struct path
|
|||
/** Counter for dropped messages due to reordering */
|
||||
unsigned int dropped;
|
||||
|
||||
/** A timer used for fixed rate transmission. */
|
||||
timer_t timer;
|
||||
/** The thread id for this path */
|
||||
pthread_t recv_tid;
|
||||
/** A second thread id for fixed rate sending thread */
|
||||
|
|
|
@ -26,9 +26,9 @@ struct list paths;
|
|||
/** Send messages asynchronously */
|
||||
static void * path_send(void *arg)
|
||||
{
|
||||
struct path *p = arg;
|
||||
|
||||
int sig;
|
||||
struct path *p = (struct path *) arg;
|
||||
timer_t tmr;
|
||||
sigset_t set;
|
||||
|
||||
struct sigevent sev = {
|
||||
|
@ -47,10 +47,10 @@ static void * path_send(void *arg)
|
|||
if(pthread_sigmask(SIG_BLOCK, &set, NULL))
|
||||
serror("Set signal mask");
|
||||
|
||||
if (timer_create(CLOCK_REALTIME, &sev, &tmr))
|
||||
if (timer_create(CLOCK_REALTIME, &sev, &p->timer))
|
||||
serror("Failed to create timer");
|
||||
|
||||
if (timer_settime(tmr, 0, &its, NULL))
|
||||
if (timer_settime(p->timer, 0, &its, NULL))
|
||||
serror("Failed to start timer");
|
||||
|
||||
while (1) {
|
||||
|
@ -178,6 +178,8 @@ int path_stop(struct path *p)
|
|||
if (p->rate) {
|
||||
pthread_cancel(p->sent_tid);
|
||||
pthread_join(p->sent_tid, NULL);
|
||||
|
||||
timer_delete(p->timer);
|
||||
}
|
||||
|
||||
if (p->sent || p->received) {
|
||||
|
|
Loading…
Add table
Reference in a new issue