summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386/bits/pthreadtypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/i386/bits/pthreadtypes.h')
-rw-r--r--libc/sysdeps/linux/i386/bits/pthreadtypes.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/i386/bits/pthreadtypes.h b/libc/sysdeps/linux/i386/bits/pthreadtypes.h
index db4c3790c..3ee5c4813 100644
--- a/libc/sysdeps/linux/i386/bits/pthreadtypes.h
+++ b/libc/sysdeps/linux/i386/bits/pthreadtypes.h
@@ -25,8 +25,9 @@
/* Fast locks (not abstract because mutexes and conditions aren't abstract). */
struct _pthread_fastlock
{
- long int __status; /* "Free" or "taken" or head of waiting list */
- int __spinlock; /* For compare-and-swap emulation */
+ long int __status; /* "Free" or "taken" or head of waiting list */
+ int __spinlock; /* Used by compare_and_swap emulation. Also,
+ adaptive SMP lock stores spin count here. */
};
#ifndef _PTHREAD_DESCR_DEFINED
@@ -37,7 +38,7 @@ typedef struct _pthread_descr_struct *_pthread_descr;
/* Attributes for threads. */
-typedef struct
+typedef struct __pthread_attr_s
{
int __detachstate;
int __schedpolicy;
@@ -115,6 +116,25 @@ typedef struct
} pthread_rwlockattr_t;
#endif
+#ifdef __USE_XOPEN2K
+/* POSIX spinlock data type. */
+typedef volatile int pthread_spinlock_t;
+
+/* POSIX barrier. */
+typedef struct {
+ struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */
+ int __ba_required; /* Threads needed for completion */
+ int __ba_present; /* Threads waiting */
+ _pthread_descr __ba_waiting; /* Queue of waiting threads */
+} pthread_barrier_t;
+
+/* barrier attribute */
+typedef struct {
+ int __pshared;
+} pthread_barrierattr_t;
+
+#endif
+
/* Thread identifiers */
typedef unsigned long int pthread_t;