mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
rtp: fix joining of re_main thread
This commit is contained in:
parent
99cae8903d
commit
c1c1eb1951
1 changed files with 10 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
|||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <re/re_types.h>
|
||||
#include <re/re_main.h>
|
||||
|
@ -228,6 +229,14 @@ int rtp_type_start()
|
|||
return ret;
|
||||
}
|
||||
|
||||
struct sigaction sa;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sa.sa_sigaction = stop_handler;
|
||||
|
||||
ret = sigaction(SIGUSR1, &sa, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -236,8 +245,7 @@ int rtp_type_stop()
|
|||
int ret;
|
||||
|
||||
/* Join worker thread */
|
||||
re_cancel();
|
||||
pthread_cancel(re_pthread); /* @todo avoid using pthread_cancel */
|
||||
pthread_kill(re_pthread, SIGUSR1);
|
||||
ret = pthread_join(re_pthread, NULL);
|
||||
if (ret) {
|
||||
error("Error joining rtp node type pthread");
|
||||
|
|
Loading…
Add table
Reference in a new issue