From: Ulrich Drepper Date: Wed, 27 Oct 1999 00:33:00 +0000 (+0000) Subject: Update. X-Git-Tag: upstream/2.30~26638 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8dd1e494527b0df2b5c18446d329cc51a1fd8584;p=external%2Fglibc.git Update. 1999-10-26 Ulrich Drepper * restart.h (suspend_with_cancellation): Rewrite as a macro. * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline. --- diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index db11009..53aea3f 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,9 @@ +1999-10-26 Ulrich Drepper + + * restart.h (suspend_with_cancellation): Rewrite as a macro. + + * condvar.c (pthread_cond_timedwait_relative): Don't mark as inline. + 1999-10-25 Andreas Jaeger * internals.h: Remove K&R compatibility. diff --git a/linuxthreads/condvar.c b/linuxthreads/condvar.c index 672ccb1..2ea7513 100644 --- a/linuxthreads/condvar.c +++ b/linuxthreads/condvar.c @@ -61,7 +61,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) return 0; } -static inline int +static int pthread_cond_timedwait_relative(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec * reltime) 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); \ + } \ }