summaryrefslogtreecommitdiff
path: root/include/pthread/pthread.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2007-03-04 00:05:21 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2007-03-04 00:05:21 +0000
commit0924954a436fe55698686e4c750e777fb058ad25 (patch)
tree7c574d341803991b0c9a1fea7a6a06624f81f99f /include/pthread/pthread.h
parent47f99033b358fb41d7c9f8f2b2f8aa221cbcc387 (diff)
2006-03-04 Samuel Thibault <samuel.thibault@ens-lyon.org>
* libpthread/include/pthread/pthread.h: Add the restrict keyword where appropriate for full compliance. * libpthread/pthread/pt-internal.h: Likewise. * libpthread/sysdeps/generic/bits/mutex.h: Likewise. * libpthread/sysdeps/generic/bits/rwlock.h: Likewise. * libpthread/TODO: Drop that TODO item.
Diffstat (limited to 'include/pthread/pthread.h')
-rw-r--r--include/pthread/pthread.h127
1 files changed, 64 insertions, 63 deletions
diff --git a/include/pthread/pthread.h b/include/pthread/pthread.h
index 891ed32..21a9b51 100644
--- a/include/pthread/pthread.h
+++ b/include/pthread/pthread.h
@@ -96,8 +96,8 @@ extern int pthread_attr_destroy (pthread_attr_t *attr);
/* Return the value of the inheritsched attribute in *ATTR in
*INHERITSCHED. */
-extern int pthread_attr_getinheritsched (const pthread_attr_t *attr,
- int *inheritsched);
+extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict attr,
+ int *__restrict inheritsched);
/* Set the value of the inheritsched attribute in *ATTR to
INHERITSCHED. */
@@ -106,17 +106,17 @@ extern int pthread_attr_setinheritsched (pthread_attr_t *attr,
/* Return the value of the schedparam attribute in *ATTR in *PARAM. */
-extern int pthread_attr_getschedparam (const pthread_attr_t *attr,
- struct sched_param *param);
+extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict attr,
+ struct sched_param *__restrict param);
/* Set the value of the schedparam attribute in *ATTR to PARAM. */
-extern int pthread_attr_setschedparam (pthread_attr_t *attr,
- const struct sched_param *param);
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict attr,
+ const struct sched_param *__restrict param);
/* Return the value of the schedpolicy attribute in *ATTR to *POLICY. */
-extern int pthread_attr_getschedpolicy (const pthread_attr_t *attr,
- int *policy);
+extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict attr,
+ int *__restrict policy);
/* Set the value of the schedpolicy attribute in *ATTR to POLICY. */
extern int pthread_attr_setschedpolicy (pthread_attr_t *attr,
@@ -125,8 +125,8 @@ extern int pthread_attr_setschedpolicy (pthread_attr_t *attr,
/* Return the value of the contentionscope attribute in *ATTR in
*CONTENTIONSCOPE. */
-extern int pthread_attr_getscope (const pthread_attr_t *attr,
- int *contentionscope);
+extern int pthread_attr_getscope (const pthread_attr_t *__restrict attr,
+ int *__restrict contentionscope);
/* Set the value of the contentionscope attribute in *ATTR to
CONTENTIONSCOPE. */
@@ -136,8 +136,8 @@ extern int pthread_attr_setscope (pthread_attr_t *attr,
/* Return the value of the stackaddr attribute in *ATTR in
*STACKADDR. */
-extern int pthread_attr_getstackaddr (const pthread_attr_t *attr,
- void **stackaddr);
+extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict attr,
+ void **__restrict stackaddr);
/* Set the value of the stackaddr attribute in *ATTR to STACKADDR. */
extern int pthread_attr_setstackaddr (pthread_attr_t *attr,
@@ -146,9 +146,9 @@ extern int pthread_attr_setstackaddr (pthread_attr_t *attr,
/* Return the value of the stackaddr and stacksize attributes in *ATTR
in *STACKADDR and *STACKSIZE respectively. */
-extern int pthread_attr_getstack (const pthread_attr_t *attr,
- void **stackaddr,
- size_t *stacksize);
+extern int pthread_attr_getstack (const pthread_attr_t *__restrict attr,
+ void **__restrict stackaddr,
+ size_t *__restrict stacksize);
/* Set the value of the stackaddr and stacksize attributes in *ATTR to
STACKADDR and STACKSIZE respectively. */
@@ -170,8 +170,8 @@ extern int pthread_attr_setdetachstate (pthread_attr_t *attr,
/* Return the value of the guardsize attribute in *ATTR in
*GUARDSIZE. */
-extern int pthread_attr_getguardsize (const pthread_attr_t *attr,
- size_t *guardsize);
+extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict attr,
+ size_t *__restrict guardsize);
/* Set the value of the guardsize attribute in *ATTR to GUARDSIZE. */
extern int pthread_attr_setguardsize (pthread_attr_t *attr,
@@ -180,8 +180,8 @@ extern int pthread_attr_setguardsize (pthread_attr_t *attr,
/* Return the value of the stacksize attribute in *ATTR in
*STACKSIZE. */
-extern int pthread_attr_getstacksize (const pthread_attr_t *attr,
- size_t *stacksize);
+extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict attr,
+ size_t *__restrict stacksize);
/* Set the value of the stacksize attribute in *ATTR to STACKSIZE. */
extern int pthread_attr_setstacksize (pthread_attr_t *attr,
@@ -190,9 +190,10 @@ extern int pthread_attr_setstacksize (pthread_attr_t *attr,
/* Create a thread with attributes given by ATTR, executing
START_ROUTINE with argument ARG. */
-extern int pthread_create (pthread_t *__threadp,
- __const pthread_attr_t *__attr,
- void *(*__start_routine)(void *), void *__arg);
+extern int pthread_create (pthread_t *__restrict __threadp,
+ __const pthread_attr_t *__restrict __attr,
+ void *(*__start_routine)(void *),
+ void *__restrict __arg);
/* Terminate the current thread and make STATUS available to any
thread that might join us. */
@@ -251,8 +252,8 @@ extern int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
/* Return the value of the prioceiling attribute in *ATTR in
*PRIOCEILING. */
-extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr,
- int *prioceiling);
+extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict attr,
+ int *__restrict prioceiling);
/* Set the value of the prioceiling attribute in *ATTR to
PRIOCEILING. */
@@ -262,8 +263,8 @@ extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr,
/* Return the value of the protocol attribute in *ATTR in
*PROTOCOL. */
-extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
- int *protocol);
+extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict attr,
+ int *__restrict protocol);
/* Set the value of the protocol attribute in *ATTR to PROTOCOL. */
extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
@@ -272,8 +273,8 @@ extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
/* Return the value of the process shared attribute in *ATTR in
*PSHARED. */
-extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
- int *pshared);
+extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict attr,
+ int *__restrict pshared);
/* Set the value of the process shared attribute in *ATTR to
PSHARED. */
@@ -282,8 +283,8 @@ extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr,
/* Return the value of the type attribute in *ATTR in *TYPE. */
-extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr,
- int *type);
+extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict attr,
+ int *__restrict type);
/* Set the value of the type attribute in *ATTR to TYPE. */
extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr,
@@ -300,8 +301,8 @@ typedef struct __pthread_mutex pthread_mutex_t;
/* Create a mutex with attributes given by ATTR and store it in
*__MUTEX. */
-extern int pthread_mutex_init (struct __pthread_mutex *__mutex,
- const pthread_mutexattr_t *attr);
+extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex,
+ const pthread_mutexattr_t *__restrict attr);
/* Destroy the mutex __MUTEX. */
extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex);
@@ -313,22 +314,22 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex);
extern int pthread_mutex_trylock (pthread_mutex_t *__mutex);
/* Try to lock MUTEX, block until *ABSTIME if it is already held. */
-extern int pthread_mutex_timedlock (struct __pthread_mutex *mutex,
- const struct timespec *abstime);
+extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict mutex,
+ const struct timespec *__restrict abstime);
/* Unlock MUTEX. */
extern int pthread_mutex_unlock (pthread_mutex_t *__mutex);
/* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */
-extern int pthread_mutex_getprioceiling (const pthread_mutex_t *mutex,
- int *prioceiling);
+extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict mutex,
+ int *__restrict prioceiling);
/* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO
and return the old priority ceiling in *OLDPRIO. Before returning,
release the mutex. */
-extern int pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prio,
- int *oldprio);
+extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict mutex,
+ int prio, int *__restrict oldprio);
@@ -347,8 +348,8 @@ extern int pthread_condattr_destroy (pthread_condattr_t *attr);
/* Return the value of the clock attribute in *ATTR in *CLOCK_ID. */
-extern int pthread_condattr_getclock (const pthread_condattr_t *attr,
- clockid_t *clock_id);
+extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict attr,
+ clockid_t *__restrict clock_id);
/* Set the value of the clock attribute in *ATTR to CLOCK_ID. */
extern int pthread_condattr_setclock (pthread_condattr_t *attr,
@@ -357,8 +358,8 @@ extern int pthread_condattr_setclock (pthread_condattr_t *attr,
/* Return the value of the process shared attribute in *ATTR in
*PSHARED. */
-extern int pthread_condattr_getpshared (const pthread_condattr_t *attr,
- int *pshared);
+extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict attr,
+ int *__restrict pshared);
/* Set the value of the process shared attribute in *ATTR to
PSHARED. */
@@ -374,8 +375,8 @@ typedef struct __pthread_cond pthread_cond_t;
#define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER
-extern int pthread_cond_init (pthread_cond_t *cond,
- const pthread_condattr_t *attr);
+extern int pthread_cond_init (pthread_cond_t *__restrict cond,
+ const pthread_condattr_t *__restrict attr);
extern int pthread_cond_destroy (pthread_cond_t *cond);
@@ -389,16 +390,16 @@ extern int pthread_cond_broadcast (pthread_cond_t *__cond);
/* Block on condition variable COND. MUTEX should be held by the
calling thread. On success, MUTEX will be held by the calling
thread. */
-extern int pthread_cond_wait (pthread_cond_t *__cond,
- pthread_mutex_t *__mutex);
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex);
/* Block on condition variable COND. MUTEX should be held by the
calling thread. On success, MUTEX will be held by the calling
thread. If the time specified by ABSTIME passes, ETIMEDOUT is
returned, and MUTEX will nevertheless be held. */
-extern int pthread_cond_timedwait (pthread_cond_t *__cond,
- pthread_mutex_t *__mutex,
- __const struct timespec *__abstime);
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict __abstime);
/* Spin locks. */
@@ -482,8 +483,8 @@ extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr);
/* Return the value of the process shared attribute in *ATTR in
*PSHARED. */
-extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr,
- int *pshared);
+extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict attr,
+ int *__restrict pshared);
/* Set the value of the process shared atrribute in *ATTR to
PSHARED. */
@@ -499,8 +500,8 @@ typedef struct __pthread_rwlock pthread_rwlock_t;
/* Create a rwlock object with attributes given by ATTR and strore the
result in *RWLOCK. */
-extern int pthread_rwlock_init (pthread_rwlock_t *rwlock,
- const pthread_rwlockattr_t *attr);
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict rwlock,
+ const pthread_rwlockattr_t *__restrict attr);
/* Destroy the rwlock *RWLOCK. */
extern int pthread_rwlock_destroy (pthread_rwlock_t *rwlock);
@@ -513,8 +514,8 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock);
/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if
it is already held. */
-extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *rwlock,
- const struct timespec *abstime);
+extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict rwlock,
+ const struct timespec *__restrict abstime);
/* Acquire the rwlock *RWLOCK for writing. */
extern int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock);
@@ -524,8 +525,8 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock);
/* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if
it is already held. */
-extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock,
- const struct timespec *abstime);
+extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict rwlock,
+ const struct timespec *__restrict abstime);
/* Release the lock held by the current thread on *RWLOCK. */
extern int pthread_rwlock_unlock (pthread_rwlock_t *rwlock);
@@ -582,8 +583,8 @@ extern int pthread_barrierattr_destroy (pthread_barrierattr_t *attr);
/* Return the value of the process shared attribute in *ATTR in
*PSHARED. */
-extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *attr,
- int *pshared);
+extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict attr,
+ int *__restrict pshared);
/* Set the value of the process shared atrribute in *ATTR to
PSHARED. */
@@ -602,8 +603,8 @@ typedef struct __pthread_barrier pthread_barrier_t;
#define PTHREAD_BARRIER_SERIAL_THREAD -1
/* Initialize barrier BARRIER. */
-extern int pthread_barrier_init (pthread_barrier_t *barrier,
- const pthread_barrierattr_t *attr,
+extern int pthread_barrier_init (pthread_barrier_t *__restrict barrier,
+ const pthread_barrierattr_t *__restrict attr,
unsigned count);
/* Destroy barrier BARRIER. */
@@ -687,8 +688,8 @@ extern int pthread_getcpuclockid (pthread_t thread, clockid_t *clock);
/* Scheduling. */
/* Return thread THREAD's scheduling paramters. */
-extern int pthread_getschedparam (pthread_t thread, int *policy,
- struct sched_param *param);
+extern int pthread_getschedparam (pthread_t thread, int *__restrict policy,
+ struct sched_param *__restrict param);
/* Set thread THREAD's scheduling paramters. */
extern int pthread_setschedparam (pthread_t thread, int policy,