MEDIUM: ring/applet: turn the wait_entry list to an mt_list instead

Rings are keeping a lock only for the list, which apparently doesn't
need anything more than an mt_list, so let's first turn it into that
before dropping the lock. There should be no visible effect.
This commit is contained in:
Willy Tarreau
2024-02-28 17:04:40 +01:00
parent 04f1e3f3d9
commit a2d2dbf210
8 changed files with 28 additions and 24 deletions

View File

@@ -97,7 +97,7 @@ struct appctx {
struct buffer_wait buffer_wait; /* position in the list of objects waiting for a buffer */
struct task *t; /* task associated to the applet */
struct freq_ctr call_rate; /* appctx call rate */
struct list wait_entry; /* entry in a list of waiters for an event (e.g. ring events) */
struct mt_list wait_entry; /* entry in a list of waiters for an event (e.g. ring events) */
/* The pointer seen by application code is appctx->svcctx. In 2.7 the
* anonymous union and the "ctx" struct disappeared, and the struct

View File

@@ -95,7 +95,7 @@
struct dns_ring {
struct buffer buf; // storage area
struct list waiters; // list of waiters, for now, CLI "show event"
struct mt_list waiters; // list of waiters, for now, CLI "show event"
__decl_thread(HA_RWLOCK_T lock);
int readers_count;
};

View File

@@ -121,7 +121,7 @@ struct ring_storage {
/* this is the ring definition, config, waiters etc */
struct ring {
struct ring_storage *storage; // the mapped part
struct list waiters; // list of waiters, for now, CLI "show event"
struct mt_list waiters; // list of waiters, for now, CLI "show event"
__decl_thread(HA_RWLOCK_T lock);
int readers_count;
uint flags; // RING_FL_*