mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-21 14:23:34 +02:00
MINOR: ring: add a flag to indicate a mapped file
Till now we used to rely on a heuristic pointer comparison to check if a ring was mapped or allocated. Better assign a flag to clarify this because it's going to become difficult otherwise.
This commit is contained in:
@@ -96,6 +96,9 @@
|
||||
#define RING_WF_WAIT_MODE 0x00000001 /* wait for new contents */
|
||||
#define RING_WF_SEEK_NEW 0x00000002 /* seek to new contents */
|
||||
|
||||
/* ring flags */
|
||||
#define RING_FL_MAPPED 0x00000001 /* mmapped area, must not free() */
|
||||
|
||||
/* keep values below in decimal, they may be dumped in error messages */
|
||||
#define RING_WRITING_SIZE 255 /* the next message's size is being written */
|
||||
#define RING_MAX_READERS 254 /* highest supported value for RC */
|
||||
@@ -105,6 +108,7 @@ struct ring {
|
||||
struct list waiters; // list of waiters, for now, CLI "show event"
|
||||
__decl_thread(HA_RWLOCK_T lock);
|
||||
int readers_count;
|
||||
uint flags; // RING_FL_*
|
||||
};
|
||||
|
||||
#endif /* _HAPROXY_RING_T_H */
|
||||
|
||||
Reference in New Issue
Block a user