mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 23:31:40 +02:00
MINOR: memory: Only init the pool spinlock once.
In pool_create(), only initialize the pool spinlock if we just created the pool, in the event we're reusing it, there's no need to initialize it again.
This commit is contained in:
parent
b6fa08bc7b
commit
8af97eb4a1
@ -139,11 +139,11 @@ struct pool_head *create_pool(char *name, unsigned int size, unsigned int flags)
|
|||||||
for (thr = 0; thr < MAX_THREADS; thr++)
|
for (thr = 0; thr < MAX_THREADS; thr++)
|
||||||
pool_cache[thr][idx].size = size;
|
pool_cache[thr][idx].size = size;
|
||||||
}
|
}
|
||||||
|
#ifndef CONFIG_HAP_LOCKLESS_POOLS
|
||||||
|
HA_SPIN_INIT(&pool->lock);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
pool->users++;
|
pool->users++;
|
||||||
#ifndef CONFIG_HAP_LOCKLESS_POOLS
|
|
||||||
HA_SPIN_INIT(&pool->lock);
|
|
||||||
#endif
|
|
||||||
return pool;
|
return pool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user