diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-02-15 05:04:02 -0800 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-02-15 14:18:17 +0100 |
commit | b65a82e4e757c1e6cb7073916a29bf7ff3170529 (patch) | |
tree | 04a4e825ee9d2665934b27ce07e6cb9ddeb68831 /hurd | |
parent | fe66db99f49e009ee4a89827fdb6bf97a6600c58 (diff) | |
download | glibc-b65a82e4e757c1e6cb7073916a29bf7ff3170529.zip glibc-b65a82e4e757c1e6cb7073916a29bf7ff3170529.tar.gz glibc-b65a82e4e757c1e6cb7073916a29bf7ff3170529.tar.bz2 |
hurd: Add THREAD_GET/SETMEM/_NC
Store them in the TCB, and use them for accessing _hurd_sigstate.
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/hurd/signal.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h index 6583dcb..ef6a8e6 100644 --- a/hurd/hurd/signal.h +++ b/hurd/hurd/signal.h @@ -164,9 +164,9 @@ extern void _hurd_sigstate_delete (thread_t thread); _HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate * _hurd_self_sigstate (void) { - if (THREAD_SELF->_hurd_sigstate == NULL) - THREAD_SELF->_hurd_sigstate = _hurd_thread_sigstate (__mach_thread_self ()); - return THREAD_SELF->_hurd_sigstate; + if (THREAD_GETMEM (THREAD_SELF, _hurd_sigstate) == NULL) + THREAD_SETMEM (THREAD_SELF, _hurd_sigstate, _hurd_thread_sigstate (__mach_thread_self ())); + return THREAD_GETMEM (THREAD_SELF, _hurd_sigstate); } # endif #endif @@ -210,14 +210,15 @@ _hurd_critical_section_lock (void) return NULL; #endif - ss = THREAD_SELF->_hurd_sigstate; + ss = THREAD_GETMEM (THREAD_SELF, _hurd_sigstate); if (ss == NULL) { /* The thread variable is unset; this must be the first time we've asked for it. In this case, the critical section flag cannot possible already be set. Look up our sigstate structure the slow way. */ - ss = THREAD_SELF->_hurd_sigstate = _hurd_thread_sigstate (__mach_thread_self ()); + ss = _hurd_thread_sigstate (__mach_thread_self ()); + THREAD_SETMEM(THREAD_SELF, _hurd_sigstate, ss); } if (! __spin_try_lock (&ss->critical_section_lock)) |