diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-02-27 18:13:05 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-02-27 18:13:05 +0000 |
commit | 187dd78d7bd1c03fcf16e54a30314512d38e1a4a (patch) | |
tree | 9780638e5286b40da74a128c9f540a9ea720862f /libpthread/linuxthreads/restart.h | |
parent | d4d6e2c50565da18253cd0d6f3332484142b6587 (diff) |
Major update for pthreads, based in large part on improvements
from glibc 2.3. This should make threads much more efficient.
-Erik
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 } |