diff options
author | Dimitri Staessens <[email protected]> | 2022-02-26 18:20:08 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2022-03-03 12:05:57 +0100 |
commit | 8969cd1f19409b110c761ed5dda1d6cb57399a64 (patch) | |
tree | 89cd87dccb5dacc8d2f3aacc85ca62776e555bf5 /src/lib/shm_rbuff_ll.c | |
parent | 865515e2fe4651978f355613c5972dcdcfd92ddd (diff) | |
download | ouroboros-8969cd1f19409b110c761ed5dda1d6cb57399a64.tar.gz ouroboros-8969cd1f19409b110c761ed5dda1d6cb57399a64.zip |
lib: Flag all flows down as the IRMd exits
On exit of the IRMd all flows will now be flagged as down, so external
applications will not hang anymore. Note: reads keep work from flows
that are down until there are no more remaining packets in the buffer,
but no more packets can be written.
When the RIB is used, the external application may exit a bit later
than the IRMd, so I added a brief sleep before the IRMd tries to
remove the fuse main directory.
Signed-off-by: Dimitri Staessens <[email protected]>
Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/lib/shm_rbuff_ll.c')
-rw-r--r-- | src/lib/shm_rbuff_ll.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/shm_rbuff_ll.c b/src/lib/shm_rbuff_ll.c index eef8a2fb..880d81dc 100644 --- a/src/lib/shm_rbuff_ll.c +++ b/src/lib/shm_rbuff_ll.c @@ -31,6 +31,11 @@ void shm_rbuff_destroy(struct shm_rbuff * rb) sprintf(fn, SHM_RBUFF_PREFIX "%d.%d", rb->pid, rb->flow_id); + __sync_bool_compare_and_swap(rb->acl, *rb->acl, ACL_FLOWDOWN); + + pthread_cond_broadcast(rb->del); + pthread_cond_broadcast(rb->add); + shm_rbuff_close(rb); shm_unlink(fn); |