summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-06-08 16:14:23 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-06-08 16:14:23 +0200
commit5c049ef4fb90faa341e18f2d752c719fb49ff648 (patch)
treea1af5576b35e20ea4562ad32d2c3ab4ff1ae32c7 /src/irmd/main.c
parenta58e8743dad97758947470c7d72f5820955f9e82 (diff)
parent1c98f0bedc1d98d468ad0d89e57207535d068844 (diff)
downloadouroboros-5c049ef4fb90faa341e18f2d752c719fb49ff648.tar.gz
ouroboros-5c049ef4fb90faa341e18f2d752c719fb49ff648.zip
Merge branch 'testing' into be
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 574223b0..aeb43f0d 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -134,7 +134,6 @@ struct {
struct tpm * tpm; /* thread pool manager */
pthread_t irm_sanitize; /* clean up irmd resources */
- pthread_t shm_sanitize; /* keep track of rdrbuff use */
pthread_t acceptor; /* accept new commands */
} irmd;
@@ -1683,43 +1682,6 @@ void irmd_sig_handler(int sig,
}
}
-void * shm_sanitize(void * o)
-{
- struct list_head * p = NULL;
- struct timespec ts = {SHM_SAN_HOLDOFF / 1000,
- (SHM_SAN_HOLDOFF % 1000) * MILLION};
- ssize_t idx;
-
- (void) o;
-
- while (irmd_get_state() == IRMD_RUNNING) {
- if (shm_rdrbuff_wait_full(irmd.rdrb, &ts) == -ETIMEDOUT)
- continue;
-
- pthread_rwlock_wrlock(&irmd.flows_lock);
-
- list_for_each(p, &irmd.irm_flows) {
- struct irm_flow * f =
- list_entry(p, struct irm_flow, next);
- if (kill(f->n_pid, 0) < 0) {
- while ((idx = shm_rbuff_read(f->n_rb)) >= 0)
- shm_rdrbuff_remove(irmd.rdrb, idx);
- continue;
- }
-
- if (kill(f->n_1_pid, 0) < 0) {
- while ((idx = shm_rbuff_read(f->n_1_rb)) >= 0)
- shm_rdrbuff_remove(irmd.rdrb, idx);
- continue;
- }
- }
-
- pthread_rwlock_unlock(&irmd.flows_lock);
- }
-
- return (void *) 0;
-}
-
void * irm_sanitize(void * o)
{
struct timespec now;
@@ -2362,11 +2324,6 @@ int main(int argc,
goto fail_irm_sanitize;
}
- if (pthread_create(&irmd.shm_sanitize, NULL, shm_sanitize, irmd.rdrb)) {
- irmd_set_state(IRMD_NULL);
- goto fail_shm_sanitize;
- }
-
if (pthread_create(&irmd.acceptor, NULL, acceptloop, NULL)) {
irmd_set_state(IRMD_NULL);
goto fail_acceptor;
@@ -2374,7 +2331,6 @@ int main(int argc,
pthread_join(irmd.acceptor, NULL);
pthread_join(irmd.irm_sanitize, NULL);
- pthread_join(irmd.shm_sanitize, NULL);
tpm_stop(irmd.tpm);
@@ -2393,8 +2349,6 @@ int main(int argc,
exit(EXIT_SUCCESS);
fail_acceptor:
- pthread_join(irmd.shm_sanitize, NULL);
- fail_shm_sanitize:
pthread_join(irmd.irm_sanitize, NULL);
fail_irm_sanitize:
tpm_stop(irmd.tpm);