aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/restart.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-27 00:33:00 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-27 00:33:00 +0000
commit8dd1e494527b0df2b5c18446d329cc51a1fd8584 (patch)
treed0711f7d0dd27de242a2744ab110612f367f571e /linuxthreads/restart.h
parent79b3c4ff7952f9196955eca341a2debd774d35f4 (diff)
downloadglibc-8dd1e494527b0df2b5c18446d329cc51a1fd8584.zip
glibc-8dd1e494527b0df2b5c18446d329cc51a1fd8584.tar.gz
glibc-8dd1e494527b0df2b5c18446d329cc51a1fd8584.tar.bz2
Update.
1999-10-26 Ulrich Drepper <drepper@cygnus.com> * restart.h (suspend_with_cancellation): Rewrite as a macro. * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline.
Diffstat (limited to 'linuxthreads/restart.h')
-rw-r--r--linuxthreads/restart.h43
1 files changed, 22 insertions, 21 deletions
diff --git a/linuxthreads/restart.h b/linuxthreads/restart.h
index 54a6f50..7492013 100644
--- a/linuxthreads/restart.h
+++ b/linuxthreads/restart.h
@@ -33,25 +33,26 @@ static inline void suspend(pthread_descr self)
} while (self->p_signal !=__pthread_sig_restart );
}
-static inline void suspend_with_cancellation(pthread_descr self)
-{
- sigset_t mask;
- sigjmp_buf jmpbuf;
-
- sigprocmask(SIG_SETMASK, NULL, &mask); /* Get current signal mask */
- sigdelset(&mask, __pthread_sig_restart); /* Unblock the restart signal */
- /* No need to save the signal mask, we'll restore it ourselves */
- if (sigsetjmp(jmpbuf, 0) == 0) {
- self->p_cancel_jmp = &jmpbuf;
- if (! (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE)) {
- do {
- self->p_signal = 0;
- sigsuspend(&mask); /* Wait for a signal */
- } while (self->p_signal != __pthread_sig_restart);
- }
- self->p_cancel_jmp = NULL;
- } else {
- sigaddset(&mask, __pthread_sig_restart); /* Reblock the restart signal */
- sigprocmask(SIG_SETMASK, &mask, NULL);
- }
+#define suspend_with_cancellation(self) \
+{ \
+ sigset_t mask; \
+ sigjmp_buf jmpbuf; \
+ \
+ sigprocmask(SIG_SETMASK, NULL, &mask); /* Get current signal mask */ \
+ sigdelset(&mask, __pthread_sig_restart); /* Unblock the restart signal */ \
+ /* No need to save the signal mask, we'll restore it ourselves */ \
+ if (sigsetjmp(jmpbuf, 0) == 0) { \
+ self->p_cancel_jmp = &jmpbuf; \
+ if (! (self->p_canceled \
+ && self->p_cancelstate == PTHREAD_CANCEL_ENABLE)) { \
+ do { \
+ self->p_signal = 0; \
+ sigsuspend(&mask); /* Wait for a signal */ \
+ } while (self->p_signal != __pthread_sig_restart); \
+ } \
+ self->p_cancel_jmp = NULL; \
+ } else { \
+ sigaddset(&mask, __pthread_sig_restart); /* Reblock the restart signal */ \
+ sigprocmask(SIG_SETMASK, &mask, NULL); \
+ } \
}