1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

dont error out if path thread already terminated

This commit is contained in:
Steffen Vogel 2019-03-26 17:13:42 +01:00
parent 5bb428704f
commit 0b2b9a7b17

View file

@ -26,6 +26,7 @@
#include <string.h>
#include <inttypes.h>
#include <poll.h>
#include <errno.h>
#include <villas/node/config.h>
#include <villas/utils.h>
@ -611,10 +612,13 @@ int path_stop(struct path *p)
if (p->state != STATE_STOPPING)
p->state = STATE_STOPPING;
/* Cancel the thread in case is currently in a blocking syscall */
/* Cancel the thread in case is currently in a blocking syscall.
*
* We dont care if the thread has already been terminated.
*/
ret = pthread_cancel(p->tid);
if (ret)
return ret;
if (ret && ret != ESRCH)
return ret;
ret = pthread_join(p->tid, NULL);
if (ret)