mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
CLEANUP: threads: don't register an initcall when not debugging
It's a bit overkill to register an initcall to call a function to set a lock to zero when not debugging, let's just declare the lock as pre-initialized to zero.
This commit is contained in:
parent
fcb69d768b
commit
3d18498645
@ -45,9 +45,29 @@
|
||||
#define __decl_rwlock(lock)
|
||||
#define __decl_aligned_rwlock(lock)
|
||||
|
||||
#elif !defined(DEBUG_THREAD) && !defined(DEBUG_FULL)
|
||||
|
||||
/************** THREADS ENABLED WITHOUT DEBUGGING **************/
|
||||
|
||||
/* declare a self-initializing spinlock */
|
||||
#define __decl_spinlock(lock) \
|
||||
HA_SPINLOCK_T (lock) = 0;
|
||||
|
||||
/* declare a self-initializing spinlock, aligned on a cache line */
|
||||
#define __decl_aligned_spinlock(lock) \
|
||||
HA_SPINLOCK_T (lock) __attribute__((aligned(64))) = 0;
|
||||
|
||||
/* declare a self-initializing rwlock */
|
||||
#define __decl_rwlock(lock) \
|
||||
HA_RWLOCK_T (lock) = 0;
|
||||
|
||||
/* declare a self-initializing rwlock, aligned on a cache line */
|
||||
#define __decl_aligned_rwlock(lock) \
|
||||
HA_RWLOCK_T (lock) __attribute__((aligned(64))) = 0;
|
||||
|
||||
#else /* !USE_THREAD */
|
||||
|
||||
/********************** THREADS ENABLED ************************/
|
||||
/**************** THREADS ENABLED WITH DEBUGGING ***************/
|
||||
|
||||
/* declare a self-initializing spinlock */
|
||||
#define __decl_spinlock(lock) \
|
||||
|
||||
@ -154,13 +154,13 @@ void ha_tkillall(int sig)
|
||||
raise(sig);
|
||||
}
|
||||
|
||||
/* these calls are used as callbacks at init time */
|
||||
/* these calls are used as callbacks at init time when debugging is on */
|
||||
void ha_spin_init(HA_SPINLOCK_T *l)
|
||||
{
|
||||
HA_SPIN_INIT(l);
|
||||
}
|
||||
|
||||
/* these calls are used as callbacks at init time */
|
||||
/* these calls are used as callbacks at init time when debugging is on */
|
||||
void ha_rwlock_init(HA_RWLOCK_T *l)
|
||||
{
|
||||
HA_RWLOCK_INIT(l);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user