summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-08-08 08:41:07 -0400
committerGitHub <noreply@github.com>2019-08-08 08:41:07 -0400
commit76eb017923497a173815c47cdb6f9852efd5bcb5 (patch)
tree5574246fe9b64ef908d40b30e5285068cf6690b8 /lib/thread.c
parent3a738964ec92473c21a5fe75a7fa8de28a344ff8 (diff)
parent3e41733f1bbe9ccd7d08441f5962b3dc6db2c644 (diff)
Merge pull request #4497 from opensourcerouting/rcu
RCU support
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/thread.c b/lib/thread.c
index f862ce5eb0..5756ebc1f9 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -25,6 +25,7 @@
#include "thread.h"
#include "memory.h"
+#include "frrcu.h"
#include "log.h"
#include "hash.h"
#include "command.h"
@@ -737,6 +738,9 @@ static int fd_poll(struct thread_master *m, struct pollfd *pfds, nfds_t pfdsize,
< 0) // effect a poll (return immediately)
timeout = 0;
+ rcu_read_unlock();
+ rcu_assert_read_unlocked();
+
/* add poll pipe poker */
assert(count + 1 < pfdsize);
pfds[count].fd = m->io_pipe[0];
@@ -750,6 +754,8 @@ static int fd_poll(struct thread_master *m, struct pollfd *pfds, nfds_t pfdsize,
while (read(m->io_pipe[0], &trash, sizeof(trash)) > 0)
;
+ rcu_read_lock();
+
return num;
}