From 009bae64cf278be1a49eef73e6756c1fd268da34 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 21 Dec 2001 10:14:44 +0000 Subject: A very large patch from Miles Bader to bring v850 back into working condition. Thanks Miles! -Erik --- libc/sysdeps/linux/v850/bits/pthreadtypes.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps/linux/v850/bits/pthreadtypes.h') diff --git a/libc/sysdeps/linux/v850/bits/pthreadtypes.h b/libc/sysdeps/linux/v850/bits/pthreadtypes.h index fbb10ed5c..7f9d92f8d 100644 --- a/libc/sysdeps/linux/v850/bits/pthreadtypes.h +++ b/libc/sysdeps/linux/v850/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; -- cgit v1.2.3