From ed90f46a8207cb1289704ea64bc490d5835f3010 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 14 Mar 2023 12:50:25 +0100 Subject: irmd: Remove unused function reg_entry_wait_state Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/irmd/registry.c | 39 --------------------------------------- src/irmd/registry.h | 4 ---- 2 files changed, 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); -- cgit v1.2.3