From b65a82e4e757c1e6cb7073916a29bf7ff3170529 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 15 Feb 2020 05:04:02 -0800 Subject: hurd: Add THREAD_GET/SETMEM/_NC Store them in the TCB, and use them for accessing _hurd_sigstate. --- hurd/hurd/signal.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'hurd') diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h index 6583dcb5b1..ef6a8e6687 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)) -- cgit v1.2.3