vfplot  1.0.15
About: vfplot is a program for plotting two-dimensional vector fields (supporting Gerris) fluid flows simulation files).
  Fossies Dox: vfplot-1.0.15.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pthreadextra.h
Go to the documentation of this file.
1 /*
2  pthreadextra.h
3 
4  This is taken from Aleksey Demakov [1] (with just cosmetic
5  changes) implementing the pthread barrier functionality
6  missing from OSX. The licence is BSD 2-Clause "Simplified"
7 
8  [1] https://github.com/ademakov/DarwinPthreadBarrier
9 */
10 
11 #ifndef PTHREADEXTRA_H
12 #define PTHREADEXTRA_H
13 
14 #include <pthread.h>
15 
16 #if !defined(PTHREAD_BARRIER_SERIAL_THREAD)
17 #define PTHREAD_BARRIER_SERIAL_THREAD (1)
18 #endif
19 
20 #if !defined(PTHREAD_PROCESS_PRIVATE)
21 #define PTHREAD_PROCESS_PRIVATE (42)
22 #endif
23 
24 #if !defined(PTHREAD_PROCESS_SHARED)
25 #define PTHREAD_PROCESS_SHARED (43)
26 #endif
27 
28 typedef struct {
29 
31 
32 typedef struct {
33  pthread_mutex_t mutex;
34  pthread_cond_t cond;
35  unsigned int limit;
36  unsigned int count;
37  unsigned int phase;
39 
43  int *restrict);
46  const pthread_barrierattr_t *restrict,
47  unsigned int);
50 
51 #endif
pthread_barrierattr_setpshared
int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int)
Definition: pthreadextra.c:36
pthread_barrierattr_t
Definition: pthreadextra.h:28
pthread_barrier_wait
int pthread_barrier_wait(pthread_barrier_t *)
Definition: pthreadextra.c:83
pthread_barrierattr_destroy
int pthread_barrierattr_destroy(pthread_barrierattr_t *)
Definition: pthreadextra.c:24
pthread_barrier_t::count
unsigned int count
Definition: pthreadextra.h:36
pthread_barrier_t::cond
pthread_cond_t cond
Definition: pthreadextra.h:34
pthread_barrier_t::limit
unsigned int limit
Definition: pthreadextra.h:35
pthread_barrier_init
int pthread_barrier_init(pthread_barrier_t *restrict, const pthread_barrierattr_t *restrict, unsigned int)
pthread_barrier_t::phase
unsigned int phase
Definition: pthreadextra.h:37
pthread_barrierattr_init
int pthread_barrierattr_init(pthread_barrierattr_t *)
Definition: pthreadextra.c:19
pthread_barrier_destroy
int pthread_barrier_destroy(pthread_barrier_t *)
Definition: pthreadextra.c:76
pthread_barrier_t::mutex
pthread_mutex_t mutex
Definition: pthreadextra.h:33
pthread_barrier_t
Definition: pthreadextra.h:32
pthread_barrierattr_getpshared
int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict, int *restrict)