--- ports/sysdeps/hppa/linuxthreads/tls.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) --- a/ports/sysdeps/hppa/linuxthreads/tls.h +++ b/ports/sysdeps/hppa/linuxthreads/tls.h @@ -100,6 +100,29 @@ #define THREAD_SETMEM_NC(descr, member, value) \ ((void) sizeof (descr), THREAD_SELF->member = (value)) +/* Get and set the global scope generation counter in struct pthread. */ +#define THREAD_GSCOPE_FLAG_UNUSED 0 +#define THREAD_GSCOPE_FLAG_USED 1 +#define THREAD_GSCOPE_FLAG_WAIT 2 +#define THREAD_GSCOPE_RESET_FLAG() \ + do \ + { int __res \ + = atomic_exchange_rel (&THREAD_SELF->p_gscope_flag, \ + THREAD_GSCOPE_FLAG_UNUSED); \ + if (__res == THREAD_GSCOPE_FLAG_WAIT) \ + lll_futex_wake (&THREAD_SELF->p_gscope_flag, 1); \ + } \ + while (0) +#define THREAD_GSCOPE_SET_FLAG() \ + do \ + { \ + THREAD_SELF->p_gscope_flag = THREAD_GSCOPE_FLAG_USED; \ + atomic_write_barrier (); \ + } \ + while (0) +#define THREAD_GSCOPE_WAIT() \ + do { /* GL(dl_wait_lookup_done) () */ } while (0) + /* Install the dtv pointer. The pointer passed is to the element with index -1 which contain the length. */ # define INSTALL_DTV(tcbp, dtvp) \