diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2023-03-14 12:50:25 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2023-03-18 17:12:27 +0100 |
commit | ed90f46a8207cb1289704ea64bc490d5835f3010 (patch) | |
tree | adfa5098e51d521984040a369e67f779d2dc2ba7 /src/irmd | |
parent | 540e8b531a1f02b3b2cc58ac246ace16aabe774e (diff) | |
download | ouroboros-ed90f46a8207cb1289704ea64bc490d5835f3010.tar.gz ouroboros-ed90f46a8207cb1289704ea64bc490d5835f3010.zip |
irmd: Remove unused function reg_entry_wait_state
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/irmd')
-rw-r--r-- | src/irmd/registry.c | 39 | ||||
-rw-r--r-- | src/irmd/registry.h | 4 |
2 files changed, 0 insertions, 43 deletions
diff --git a/src/irmd/registry.c b/src/irmd/registry.c index 0aebdab7..b34e9494 100644 --- a/src/irmd/registry.c +++ b/src/irmd/registry.c @@ -455,45 +455,6 @@ int reg_entry_leave_state(struct reg_entry * e, return ret; } -int reg_entry_wait_state(struct reg_entry * e, - enum reg_name_state state, - struct timespec * timeout) -{ - struct timespec abstime; - int ret = 0; - - assert(e); - assert(state != REG_NAME_DESTROY); - - if (timeout != NULL) { - clock_gettime(PTHREAD_COND_CLOCK, &abstime); - ts_add(&abstime, timeout, &abstime); - } - - pthread_mutex_lock(&e->state_lock); - - while (e->state != state && - e->state != REG_NAME_DESTROY && - ret != -ETIMEDOUT) - if (timeout) - ret = -pthread_cond_timedwait(&e->state_cond, - &e->state_lock, - &abstime); - else - ret = -pthread_cond_wait(&e->state_cond, - &e->state_lock); - - if (e->state == REG_NAME_DESTROY) { - ret = -1; - e->state = REG_NAME_NULL; - pthread_cond_broadcast(&e->state_cond); - } - - pthread_mutex_unlock(&e->state_lock); - - return ret; -} - struct reg_entry * registry_get_entry(struct list_head * registry, const char * name) { diff --git a/src/irmd/registry.h b/src/irmd/registry.h index 222235dc..6ad0890a 100644 --- a/src/irmd/registry.h +++ b/src/irmd/registry.h @@ -98,10 +98,6 @@ int reg_entry_leave_state(struct reg_entry * e, enum reg_name_state state, struct timespec * timeout); -int reg_entry_wait_state(struct reg_entry * e, - enum reg_name_state state, - struct timespec * timeout); - struct reg_entry * registry_add_name(struct list_head * registry, const char * name); |