#define TH_FL_STUCK 0x00000001
/* This structure describes all the per-thread info we need. When threads are
- * disabled, it contains the same info for the single running thread.
+ * disabled, it contains the same info for the single running thread. This is
+ * stable across all of a thread's life, and is being pointed to by the
+ * thread-local "ti" pointer.
*/
struct thread_info {
/* pad to cache line (64B) */
- char __pad[0]; /* unused except to check remaining room */
+ char __pad[0]; /* unused except to check remaining room */
char __end[0] __attribute__((aligned(64)));
};
/* the structs are in thread.c */
extern struct thread_info ha_thread_info[MAX_THREADS];
-extern THREAD_LOCAL struct thread_info *ti; /* thread_info for the current thread */
+extern THREAD_LOCAL const struct thread_info *ti; /* thread_info for the current thread */
extern struct thread_ctx ha_thread_ctx[MAX_THREADS];
extern THREAD_LOCAL struct thread_ctx *th_ctx; /* ha_thread_ctx for the current thread */
#include <haproxy/tools.h>
struct thread_info ha_thread_info[MAX_THREADS] = { };
-THREAD_LOCAL struct thread_info *ti = &ha_thread_info[0];
+THREAD_LOCAL const struct thread_info *ti = &ha_thread_info[0];
struct thread_ctx ha_thread_ctx[MAX_THREADS] = { };
THREAD_LOCAL struct thread_ctx *th_ctx = &ha_thread_ctx[0];