1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #include <signal.h>
- #include <sys/syscall.h>
- #define __ASSUME_REALTIME_SIGNALS defined(__NR_rt_sigaction)
- static __inline__ void restart(pthread_descr th)
- {
-
- #if __ASSUME_REALTIME_SIGNALS
- __pthread_restart_new(th);
- #else
- __pthread_restart(th);
- #endif
- }
- static __inline__ void suspend(pthread_descr self)
- {
-
- #if __ASSUME_REALTIME_SIGNALS
- __pthread_wait_for_restart_signal(self);
- #else
- __pthread_suspend(self);
- #endif
- }
- static __inline__ int timedsuspend(pthread_descr self,
- const struct timespec *abstime)
- {
-
- #if __ASSUME_REALTIME_SIGNALS
- return __pthread_timedsuspend_new(self, abstime);
- #else
- return __pthread_timedsuspend(self, abstime);
- #endif
- }
|