Add barrier prototypes.
authorDavid Xu <davidxu@dragonflybsd.org>
Sat, 26 Feb 2005 02:21:56 +0000 (02:21 +0000)
committerDavid Xu <davidxu@dragonflybsd.org>
Sat, 26 Feb 2005 02:21:56 +0000 (02:21 +0000)
include/pthread.h

index 25b77d8..1410a6c 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/include/pthread.h,v 1.20.2.4 2003/05/27 18:18:01 jdp Exp $
- * $DragonFly: src/include/pthread.h,v 1.4 2004/02/26 13:58:25 joerg Exp $
+ * $DragonFly: src/include/pthread.h,v 1.5 2005/02/26 02:21:56 davidxu Exp $
  */
 #ifndef _PTHREAD_H_
 #define _PTHREAD_H_
@@ -53,6 +53,7 @@
 #define PTHREAD_KEYS_MAX                       256
 #define PTHREAD_STACK_MIN                      1024
 #define PTHREAD_THREADS_MAX                    ULONG_MAX
+#define PTHREAD_BARRIER_SERIAL_THREAD          -1
 
 /*
  * Flags for threads and thread attributes.
@@ -96,6 +97,8 @@ struct pthread_mutex_attr;
 struct pthread_once;
 struct pthread_rwlock;
 struct pthread_rwlockattr;
+struct pthread_barrier;
+struct pthread_barrier_attr;
 
 /*
  * Primitive system data type definitions required by P1003.1c.
@@ -114,6 +117,8 @@ typedef int                         pthread_key_t;
 typedef struct pthread_once            pthread_once_t;
 typedef struct pthread_rwlock          *pthread_rwlock_t;
 typedef struct pthread_rwlockattr      *pthread_rwlockattr_t;
+typedef struct pthread_barrier         *pthread_barrier_t;
+typedef struct pthread_barrierattr     *pthread_barrierattr_t;
 
 /*
  * Additional type definitions:
@@ -201,6 +206,17 @@ int                pthread_attr_setstack(pthread_attr_t *, void *, size_t);
 int            pthread_attr_setstacksize(pthread_attr_t *, size_t);
 int            pthread_attr_setstackaddr(pthread_attr_t *, void *);
 int            pthread_attr_setdetachstate(pthread_attr_t *, int);
+int            pthread_barrier_destroy(pthread_barrier_t *);
+int            pthread_barrier_init(pthread_barrier_t *,
+                       const pthread_barrierattr_t *, unsigned);
+int            pthread_barrier_wait(pthread_barrier_t *);
+int            pthread_barrierattr_destroy(pthread_barrierattr_t *);
+int            pthread_barrierattr_init(pthread_barrierattr_t *);
+#if defined(_POSIX_THREAD_PROCESS_SHARED)
+int            pthread_barrierattr_getpshared(const pthread_barrierattr_t *,
+                       int *);
+int            pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
+#endif
 void           pthread_cleanup_pop(int);
 void           pthread_cleanup_push(void (*) (void *), void *);
 int            pthread_condattr_destroy(pthread_condattr_t *);