summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-07-12 12:16:34 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-07-12 12:17:58 +0200
commiteaa2dff945366ed43b28fb1ae8e5c10ce95d9964 (patch)
treec2e257101d4f52190a5fc6e2e00e8b6d8d637932 /src/irmd/main.c
parent9f553e440bd540ac46c98fa13ddf93e81daff221 (diff)
downloadouroboros-eaa2dff945366ed43b28fb1ae8e5c10ce95d9964.tar.gz
ouroboros-eaa2dff945366ed43b28fb1ae8e5c10ce95d9964.zip
irmd: Shutdown sanitizer without cancellation
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index b2e6ba9c..db6f33de 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1514,8 +1514,9 @@ void * shm_sanitize(void * o)
(void) o;
- while (true) {
- shm_rdrbuff_wait_full(irmd.rdrb);
+ while (irmd_get_state() == IRMD_RUNNING) {
+ if (shm_rdrbuff_wait_full(irmd.rdrb, &ts) == -ETIMEDOUT)
+ continue;
pthread_rwlock_wrlock(&irmd.flows_lock);
@@ -1536,8 +1537,6 @@ void * shm_sanitize(void * o)
}
pthread_rwlock_unlock(&irmd.flows_lock);
-
- nanosleep(&ts, NULL);
}
return (void *) 0;
@@ -2247,8 +2246,6 @@ int main(int argc,
pthread_join(irmd.tpm, NULL);
pthread_join(irmd.irm_sanitize, NULL);
-
- pthread_cancel(irmd.shm_sanitize);
pthread_join(irmd.shm_sanitize, NULL);
pthread_sigmask(SIG_BLOCK, &sigset, NULL);