MINOR: pools: move pool_free_area() out of the lock in the locked version
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Apr 2021 16:19:51 +0000 (18:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Apr 2021 13:24:33 +0000 (15:24 +0200)
commitacf0c5449157a4d6d8cc43e753fc59479414432a
treeb46948d54837df44d7fab0b5b6bb3ca654880f20
parent2b5579f6da2b24bfcc7fefb4ba06d4a4aba2eb05
MINOR: pools: move pool_free_area() out of the lock in the locked version

Calling pool_free_area() inside a lock in pool_put_to_shared_cache() is
a very bad idea. Fortunately this only happens on the lowest end platforms
which almost never use threads or in very small counts.

This change consists in zeroing the pointer once already released to the
cache in the first test so that the second stage knows if it needs to
pass it to the OS or not. This has slightly reduced the length of the
include/haproxy/pool.h