haproxy/include/types/vars.h
Christopher Faulet 9dcf9b6f03 MINOR: threads: Use __decl_hathreads to declare locks
This macro should be used to declare variables or struct members depending on
the USE_THREAD compile option. It avoids the encapsulation of such declarations
between #ifdef/#endif. It is used to declare all lock variables.
2017-11-13 11:38:17 +01:00

36 lines
661 B
C

#ifndef _TYPES_VARS_H
#define _TYPES_VARS_H
#include <common/mini-clist.h>
#include <common/hathreads.h>
#include <types/sample.h>
enum vars_scope {
SCOPE_SESS = 0,
SCOPE_TXN,
SCOPE_REQ,
SCOPE_RES,
SCOPE_PROC,
};
struct vars {
struct list head;
enum vars_scope scope;
unsigned int size;
__decl_hathreads(HA_RWLOCK_T rwlock);
};
/* This struct describes a variable. */
struct var_desc {
const char *name; /* Contains the normalized variable name. */
enum vars_scope scope;
};
struct var {
struct list l; /* Used for chaining vars. */
const char *name; /* Contains the variable name. */
struct sample_data data; /* data storage. */
};
#endif