summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-06-28 00:06:52 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2008-06-28 00:06:52 +0000
commit0acb426838244a35d632eb5030b3ffcc293414e2 (patch)
tree38d9ad555d80d475c329fdbb674dfd52cefe6ba1 /sysdeps
parentc50decbb1e33f0b16cce1fa53e8c72c88315289e (diff)
2008-06-27 Samuel Thibault <samuel.thibault@ens-lyon.org>
* include/pthread/pthread.h: Do not define __need_clockid_t, include <time.h>, and define clockid_t if __clockid_defined is not defined. Include <pthread/pthreadtypes.h> (pthread_equal): New extern inline. (pthread_cleanup_push, pthread_cleanup_pop): New macros. (__pthread_process_shared, __pthread_inheritsched, __pthread_contentionscope, __pthread_detachstate, __pthread_mutex_protocol, __pthread_mutex_type, pthread_attr_t, pthread_mutex_attr_t, pthread_mutex_t, pthread_condattr_t, pthread_cond_t, pthread_spinlock_t, pthread_rwlockattr_t, pthread_rwlock_t, pthread_barrierattr_t, pthread_barrier_t, pthread_key_t, pthread_once_t): Move enums and typedefs to... * include/pthread/pthreadtypes.h: ... new file. * sysdeps/generic/bits/cancelation.h (pthread_cleanup_push): Rename macro to __pthread_cleanup_push. (pthread_cleanup_pop): Rename macro to __pthread_cleanup_pop. * sysdeps/generic/bits/barrier-attr.h (__pthread_process_shared): Forward-declare enum. * sysdeps/generic/bits/condition-attr.h (__pthread_process_shared): Likewise. * sysdeps/generic/bits/mutex-attr.h (__pthread_mutex_protocol, __pthread_process_shared, __pthread_mutex_type): Likewise. * sysdeps/generic/bits/rwlock-attr.h (__pthread_process_shared): Likewise. * sysdeps/generic/bits/thread-attr.h (__pthread_detachstate, __pthread_inheritsched, __pthread_contentionscope): Likewise. * sysdeps/generic/bits/pthread.h (pthread_t): Rename type to __pthread_t. (pthread_equal): Rename to __pthread_equal.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/bits/barrier-attr.h2
-rw-r--r--sysdeps/generic/bits/cancelation.h4
-rw-r--r--sysdeps/generic/bits/condition-attr.h2
-rw-r--r--sysdeps/generic/bits/mutex-attr.h4
-rw-r--r--sysdeps/generic/bits/pthread.h6
-rw-r--r--sysdeps/generic/bits/rwlock-attr.h2
-rw-r--r--sysdeps/generic/bits/thread-attr.h4
7 files changed, 19 insertions, 5 deletions
diff --git a/sysdeps/generic/bits/barrier-attr.h b/sysdeps/generic/bits/barrier-attr.h
index 86f3cb02..d8d09db9 100644
--- a/sysdeps/generic/bits/barrier-attr.h
+++ b/sysdeps/generic/bits/barrier-attr.h
@@ -20,6 +20,8 @@
#ifndef _BITS_BARRIER_ATTR_H
#define _BITS_BARRIER_ATTR_H 1
+enum __pthread_process_shared;
+
/* This structure describes the attributes of a POSIX thread barrier.
Note that not all of them are supported on all systems. */
struct __pthread_barrierattr
diff --git a/sysdeps/generic/bits/cancelation.h b/sysdeps/generic/bits/cancelation.h
index bb6b58a1..f94b6e34 100644
--- a/sysdeps/generic/bits/cancelation.h
+++ b/sysdeps/generic/bits/cancelation.h
@@ -32,7 +32,7 @@ struct __pthread_cancelation_handler
/* Returns the thread local location of the cleanup handler stack. */
struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
-#define pthread_cleanup_push(rt, rtarg) \
+#define __pthread_cleanup_push(rt, rtarg) \
{ \
struct __pthread_cancelation_handler **__handlers \
= __pthread_get_cleanup_stack (); \
@@ -44,7 +44,7 @@ struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
}; \
*__handlers = &__handler;
-#define pthread_cleanup_pop(execute) \
+#define __pthread_cleanup_pop(execute) \
if (execute) \
__handler.handler (__handler.arg); \
assert (*__handlers == &__handler); \
diff --git a/sysdeps/generic/bits/condition-attr.h b/sysdeps/generic/bits/condition-attr.h
index 2d48dfb6..49bbf7f1 100644
--- a/sysdeps/generic/bits/condition-attr.h
+++ b/sysdeps/generic/bits/condition-attr.h
@@ -22,6 +22,8 @@
#include <time.h>
+enum __pthread_process_shared;
+
/* User visible part of a condition attribute variable. */
struct __pthread_condattr
{
diff --git a/sysdeps/generic/bits/mutex-attr.h b/sysdeps/generic/bits/mutex-attr.h
index 883b0746..5d3d611a 100644
--- a/sysdeps/generic/bits/mutex-attr.h
+++ b/sysdeps/generic/bits/mutex-attr.h
@@ -20,6 +20,10 @@
#ifndef _BITS_MUTEX_ATTR_H
#define _BITS_MUTEX_ATTR_H 1
+enum __pthread_mutex_protocol;
+enum __pthread_process_shared;
+enum __pthread_mutex_type;
+
/* This structure describes the attributes of a POSIX mutex
attribute. */
struct __pthread_mutexattr
diff --git a/sysdeps/generic/bits/pthread.h b/sysdeps/generic/bits/pthread.h
index 5e239d67..0e8ad9e9 100644
--- a/sysdeps/generic/bits/pthread.h
+++ b/sysdeps/generic/bits/pthread.h
@@ -20,16 +20,16 @@
#ifndef _BITS_PTHREAD_H
#define _BITS_PTHREAD_H 1
-typedef int pthread_t;
+typedef int __pthread_t;
/* Return true if __T1 and __T2 both name the same thread. Otherwise,
false. */
extern int
-pthread_equal (pthread_t __t1, pthread_t __t2);
+__pthread_equal (__pthread_t __t1, __pthread_t __t2);
#ifdef __USE_EXTERN_INLINES
__extern_inline int
-pthread_equal (pthread_t __t1, pthread_t __t2)
+__pthread_equal (__pthread_t __t1, __pthread_t __t2)
{
return __t1 == __t2;
}
diff --git a/sysdeps/generic/bits/rwlock-attr.h b/sysdeps/generic/bits/rwlock-attr.h
index 44765bd6..b4f26c46 100644
--- a/sysdeps/generic/bits/rwlock-attr.h
+++ b/sysdeps/generic/bits/rwlock-attr.h
@@ -20,6 +20,8 @@
#ifndef _BITS_RWLOCK_ATTR_H
#define _BITS_RWLOCK_ATTR_H 1
+enum __pthread_process_shared;
+
/* This structure describes the attributes of a POSIX thread rwlock.
Note that not all of them are supported on all systems. */
struct __pthread_rwlockattr
diff --git a/sysdeps/generic/bits/thread-attr.h b/sysdeps/generic/bits/thread-attr.h
index 31630221..3250f515 100644
--- a/sysdeps/generic/bits/thread-attr.h
+++ b/sysdeps/generic/bits/thread-attr.h
@@ -22,6 +22,10 @@
#include <sched.h>
+enum __pthread_detachstate;
+enum __pthread_inheritsched;
+enum __pthread_contentionscope;
+
/* This structure describes the attributes of a POSIX thread. Note
that not all of them are supported on all systems. */
struct __pthread_attr