summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/sys
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2006-09-13 22:09:27 +0000
committerJeff Johnston <jjohnstn@redhat.com>2006-09-13 22:09:27 +0000
commit23754b33c3d9e4dfcc59498c3795edfc30706e56 (patch)
tree43c6c622e684388595413cca1b26397595c75e82 /newlib/libc/include/sys
parentba1bb1b36812647e07e0822238a603482b886eff (diff)
downloadcygnal-23754b33c3d9e4dfcc59498c3795edfc30706e56.tar.gz
cygnal-23754b33c3d9e4dfcc59498c3795edfc30706e56.tar.bz2
cygnal-23754b33c3d9e4dfcc59498c3795edfc30706e56.zip
2006-09-13 Joel Sherrill <joel@oarcorp.com>
* libc/include/pthread.h: Add pthread barriers, rwlocks, and spinlocks. Change const to _CONST and prefix parameter names with an underscore. * libc/include/sys/types.h: Add id and attribute types for barriers, wrlocks, and spinlocks. * libc/include/sys/features.h: Enable barriers, wrlocks, and spinlocks for RTEMS.
Diffstat (limited to 'newlib/libc/include/sys')
-rw-r--r--newlib/libc/include/sys/features.h3
-rw-r--r--newlib/libc/include/sys/types.h30
2 files changed, 33 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index 6754f1e9d..7dc948668 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -45,6 +45,9 @@ extern "C" {
#define _POSIX_SHARED_MEMORY_OBJECTS 1
#define _POSIX_SYNCHRONIZED_IO 1
#define _POSIX_TIMERS 1
+#define _POSIX_BARRIERS 200112L
+#define _POSIX_READER_WRITER_LOCKS 200112L
+#define _POSIX_SPIN_LOCKS 200112L
/* In P1003.1b but defined by drafts at least as early as P1003.1c/D10 */
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 70d919a46..c1bff4793 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -371,6 +371,36 @@ typedef struct {
#endif
#endif /* defined(_POSIX_THREADS) */
+/* POSIX Barrier Types */
+
+#if defined(_POSIX_BARRIERS)
+typedef __uint32_t pthread_barrier_t; /* POSIX Barrier Object */
+typedef struct {
+ int is_initialized; /* is this structure initialized? */
+#if defined(_POSIX_THREAD_PROCESS_SHARED)
+ int process_shared; /* allow this to be shared amongst processes */
+#endif
+} pthread_barrierattr_t;
+#endif /* defined(_POSIX_BARRIERS) */
+
+/* POSIX Spin Lock Types */
+
+#if defined(_POSIX_SPIN_LOCKS)
+typedef __uint32_t pthread_spinlock_t; /* POSIX Spin Lock Object */
+#endif /* defined(_POSIX_SPIN_LOCKS) */
+
+/* POSIX Reader/Writer Lock Types */
+
+#if defined(_POSIX_READER_WRITER_LOCKS)
+typedef __uint32_t pthread_rwlock_t; /* POSIX RWLock Object */
+typedef struct {
+ int is_initialized; /* is this structure initialized? */
+#if defined(_POSIX_THREAD_PROCESS_SHARED)
+ int process_shared; /* allow this to be shared amongst processes */
+#endif
+} pthread_rwlockattr_t;
+#endif /* defined(_POSIX_READER_WRITER_LOCKS) */
+
#endif /* !__need_inttypes */
#undef __need_inttypes