diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2008-11-23 21:21:30 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@schwinge.name> | 2010-01-25 22:34:59 +0100 |
commit | c229fbc23a60f8824632dd2f2a81f0c8fb51df98 (patch) | |
tree | f1fb320c059c7b1b6a77a7811e4678e11c1f7d82 /hurd/hurd/signal.h | |
parent | 1056e10d6c05cc5d8658bf6fb620b2a1ca6c07ce (diff) |
glibc-2.8/debian/patches/hurd-i386/submitted-extern_inline.diff 3057
Diffstat (limited to 'hurd/hurd/signal.h')
-rw-r--r-- | hurd/hurd/signal.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h index 21e30c5729..46c1fe1303 100644 --- a/hurd/hurd/signal.h +++ b/hurd/hurd/signal.h @@ -131,15 +131,17 @@ extern struct hurd_sigstate *_hurd_self_sigstate (void) #define _HURD_SIGNAL_H_EXTERN_INLINE __extern_inline #endif +#ifdef __USE_EXTERN_INLINES _HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate * _hurd_self_sigstate (void) { - struct hurd_sigstate **location = + struct hurd_sigstate **location = (struct hurd_sigstate **) (void *) __hurd_threadvar_location (_HURD_THREADVAR_SIGSTATE); if (*location == NULL) *location = _hurd_thread_sigstate (__mach_thread_self ()); return *location; } +#endif /* Thread listening on our message port; also called the "signal thread". */ @@ -166,10 +168,13 @@ extern int _hurd_core_limit; interrupted lest the signal handler try to take the same lock and deadlock result. */ +void *_hurd_critical_section_lock (void); + +#ifdef __USE_EXTERN_INLINES _HURD_SIGNAL_H_EXTERN_INLINE void * _hurd_critical_section_lock (void) { - struct hurd_sigstate **location = + struct hurd_sigstate **location = (struct hurd_sigstate **) (void *) __hurd_threadvar_location (_HURD_THREADVAR_SIGSTATE); struct hurd_sigstate *ss = *location; if (ss == NULL) @@ -191,7 +196,11 @@ _hurd_critical_section_lock (void) _hurd_critical_section_unlock to unlock it. */ return ss; } +#endif +void _hurd_critical_section_unlock (void *our_lock); + +#ifdef __USE_EXTERN_INLINES _HURD_SIGNAL_H_EXTERN_INLINE void _hurd_critical_section_unlock (void *our_lock) { @@ -201,7 +210,7 @@ _hurd_critical_section_unlock (void *our_lock) else { /* It was us who acquired the critical section lock. Unlock it. */ - struct hurd_sigstate *ss = our_lock; + struct hurd_sigstate *ss = (struct hurd_sigstate *) our_lock; sigset_t pending; __spin_lock (&ss->lock); __spin_unlock (&ss->critical_section_lock); @@ -214,6 +223,7 @@ _hurd_critical_section_unlock (void *our_lock) __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ()); } } +#endif /* Convenient macros for simple uses of critical sections. These two must be used as a pair at the same C scoping level. */ |