diff options
Diffstat (limited to 'include/pthread/pthread.h')
-rw-r--r-- | include/pthread/pthread.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/pthread/pthread.h b/include/pthread/pthread.h index 76733e0..c6e056a 100644 --- a/include/pthread/pthread.h +++ b/include/pthread/pthread.h @@ -26,6 +26,27 @@ #include <features.h> +#include <sys/cdefs.h> +#ifndef __extern_inline +/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. */ +# if !defined __cplusplus || __GNUC_PREREQ (4,3) +# if defined __GNUC_STDC_INLINE__ || defined __cplusplus +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) +# if __GNUC_PREREQ (4,3) +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__, __artificial__)) +# else +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__)) +# endif +# else +# define __extern_inline extern __inline +# define __extern_always_inline extern __always_inline +# endif +# endif +#endif + #include <sched.h> __BEGIN_DECLS @@ -289,6 +310,9 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, #include <bits/mutex.h> #define PTHREAD_MUTEX_INITIALIZER __PTHREAD_MUTEX_INITIALIZER +/* Static initializer for recursive mutexes. */ +#define PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP \ + __PTHREAD_MUTEX_RECURSIVE_INITIALIZER /* Create a mutex with attributes given by ATTR and store it in *__MUTEX. */ @@ -313,6 +337,11 @@ extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict mutex, /* Unlock MUTEX. */ extern int pthread_mutex_unlock (pthread_mutex_t *__mutex); +/* Transfer ownership of the mutex MUTEX to the thread TID. The + caller must own the lock. */ +extern int __pthread_mutex_transfer_np (struct __pthread_mutex *mutex, + pthread_t tid); + #ifdef __USE_UNIX98 /* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */ @@ -699,6 +728,11 @@ extern int pthread_setschedparam (pthread_t thread, int policy, /* Set thread THREAD's scheduling priority. */ extern int pthread_setschedprio (pthread_t thread, int prio); + + +/* Kernel-specific interfaces. */ + +#include <bits/pthread-np.h> __END_DECLS |