summaryrefslogtreecommitdiff
path: root/lib/frr_pthread.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-04-26 07:57:15 -0400
committerGitHub <noreply@github.com>2021-04-26 07:57:15 -0400
commit8123bf2bd6006ddc50b8580a5f4023a900482803 (patch)
tree73e29189161d472718ad6f68e460a58d4c3b93e4 /lib/frr_pthread.c
parentae08637827fd8a47465624c097ebf901b662fa74 (diff)
parentadf8924df66f9249e1294eee365cdebf17c897d4 (diff)
Merge pull request #8534 from opensourcerouting/threads-vs-fork
lib, pathd PCEP: creating threads before forking does _not_ work
Diffstat (limited to 'lib/frr_pthread.c')
-rw-r--r--lib/frr_pthread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c
index 03359f4d18..898fe98aad 100644
--- a/lib/frr_pthread.c
+++ b/lib/frr_pthread.c
@@ -28,6 +28,7 @@
#include "memory.h"
#include "linklist.h"
#include "zlog.h"
+#include "libfrr.h"
#include "libfrr_trace.h"
DEFINE_MTYPE_STATIC(LIB, FRR_PTHREAD, "FRR POSIX Thread");
@@ -162,6 +163,8 @@ int frr_pthread_run(struct frr_pthread *fpt, const pthread_attr_t *attr)
int ret;
sigset_t oldsigs, blocksigs;
+ assert(frr_is_after_fork || !"trying to start thread before fork()");
+
/* Ensure we never handle signals on a background thread by blocking
* everything here (new thread inherits signal mask)
*/