diff options
Diffstat (limited to 'libpthread/linuxthreads/restart.h')
-rw-r--r-- | libpthread/linuxthreads/restart.h | 26 |
1 files changed, 24 insertions, 2 deletions
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 <signal.h> +#include <sys/syscall.h> /* 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 } |