char __end[0] __attribute__((aligned(64)));
} thread_info[MAX_THREADS];
+extern THREAD_LOCAL struct thread_info *ti; /* thread_info for the current thread */
+
#define __decl_hathreads(decl)
#define __decl_spinlock(lock)
#define __decl_aligned_spinlock(lock)
static inline void ha_set_tid(unsigned int tid)
{
+ ti = &thread_info[tid];
}
static inline void ha_thread_relax(void)
extern THREAD_LOCAL unsigned int tid; /* The thread id */
extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the thread id */
+extern THREAD_LOCAL struct thread_info *ti; /* thread_info for the current thread */
extern volatile unsigned long all_threads_mask;
extern volatile unsigned long threads_want_rdv_mask;
extern volatile unsigned long threads_harmless_mask;
{
tid = data;
tid_bit = (1UL << tid);
+ ti = &thread_info[tid];
}
static inline void ha_thread_relax(void)
ha_set_tid((unsigned long)data);
#ifdef USE_THREAD
- pthread_getcpuclockid(pthread_self(), &thread_info[tid].clock_id);
+ pthread_getcpuclockid(pthread_self(), &ti->clock_id);
#else
- thread_info[tid].clock_id = CLOCK_THREAD_CPUTIME_ID;
+ ti->clock_id = CLOCK_THREAD_CPUTIME_ID;
#endif
tv_update_date(-1,-1);