]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: thread: add EXTRAS_LOCK so addons can name their locks
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 30 Oct 2026 10:54:43 +0000 (11:54 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 30 Oct 2026 11:02:13 +0000 (12:02 +0100)
Provide an unconditional EXTRAS_LOCK label so addons can name their
locks using the existing lock debugging and statistics infrastructure.
This avoids adding addon-specific lock labels or build-option guards to
the core enum. Report the label as EXTRAS in lock statistics.

include/haproxy/thread-t.h
src/thread.c

index cf4ebec6d703df5ed6896cbe33583565b3d7c664..8c363b20c430e22585c57786c96437ea749b5e60 100644 (file)
@@ -226,6 +226,7 @@ enum lock_label {
        DEBUG3_LOCK,
        DEBUG4_LOCK,
        DEBUG5_LOCK,
+       EXTRAS_LOCK,
        LOCK_LABELS
 };
 
index 56b1dc2cb62f23234d01817a50b603cbb49c05a7..4ca60a591e488d3b48d6757f8cf8942979e6eb55 100644 (file)
@@ -513,6 +513,7 @@ const char *lock_label(enum lock_label label)
        case DEBUG3_LOCK:          return "DEBUG3";
        case DEBUG4_LOCK:          return "DEBUG4";
        case DEBUG5_LOCK:          return "DEBUG5";
+       case EXTRAS_LOCK:          return "EXTRAS";
        case LOCK_LABELS:          break; /* keep compiler happy */
        };
        /* only way to come here is consecutive to an internal bug */