MEDIUM: init: use self-initializing spinlocks and rwlocks
This patch replaces a number of __decl_hathread() followed by HA_SPIN_INIT
or HA_RWLOCK_INIT by the new __decl_spinlock() or __decl_rwlock() which
automatically registers the lock for initialization in during the STG_LOCK
init stage. A few static modifiers were lost in the process, but since they
were not essential at all it was not worth extending the API to provide such
a variant.
diff --git a/src/checks.c b/src/checks.c
index 4829a54..5395093 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1632,7 +1632,7 @@
static struct list pid_list = LIST_HEAD_INIT(pid_list);
static struct pool_head *pool_head_pid_list;
-__decl_hathreads(HA_SPINLOCK_T pid_list_lock);
+__decl_spinlock(pid_list_lock);
void block_sigchld(void)
{
@@ -1736,8 +1736,6 @@
return 1;
}
- HA_SPIN_INIT(&pid_list_lock);
-
return 0;
}