From 187dd78d7bd1c03fcf16e54a30314512d38e1a4a Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 27 Feb 2003 18:13:05 +0000 Subject: Major update for pthreads, based in large part on improvements from glibc 2.3. This should make threads much more efficient. -Erik --- libpthread/linuxthreads/restart.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'libpthread/linuxthreads/restart.h') diff --git a/libpthread/linuxthreads/restart.h b/libpthread/linuxthreads/restart.h index 702d7d15c..f72fb709f 100644 --- a/libpthread/linuxthreads/restart.h +++ b/libpthread/linuxthreads/restart.h @@ -13,15 +13,37 @@ /* GNU Library General Public License for more details. */ #include +#include /* Primitives for controlling thread execution */ static inline void restart(pthread_descr th) { - __pthread_restart(th); /* see pthread.c */ + /* See pthread.c */ +#ifdef __NR_rt_sigaction + __pthread_restart_new(th); +#else + __pthread_restart(th); +#endif } static inline void suspend(pthread_descr self) { - __pthread_suspend(self); /* see pthread.c */ + /* See pthread.c */ +#ifdef __NR_rt_sigaction + __pthread_wait_for_restart_signal(self); +#else + __pthread_suspend(self); +#endif +} + +static inline int timedsuspend(pthread_descr self, + const struct timespec *abstime) +{ + /* See pthread.c */ +#ifdef __NR_rt_sigaction + return __pthread_timedsuspend_new(self, abstime); +#else + return __pthread_timedsuspend(self, abstime); +#endif } -- cgit v1.2.3