OSDN Git Service

PR c++/50020
[pf3gnuchains/gcc-fork.git] / libgomp / config / posix95 / omp-lock.h
1 /* This header is used during the build process to find the size and 
2    alignment of the public OpenMP locks, so that we can export data
3    structures without polluting the namespace.
4
5    In this POSIX95 implementation, we map the two locks to the
6    same PTHREADS primitive.  */
7
8 #include <pthread.h>
9 #include <semaphore.h>
10
11 typedef pthread_mutex_t omp_lock_25_t;
12 typedef struct { pthread_mutex_t lock; pthread_t owner; int count; } omp_nest_lock_25_t;
13 #ifdef HAVE_BROKEN_POSIX_SEMAPHORES
14 /* If we don't have working semaphores, we'll make all explicit tasks
15    tied to the creating thread.  */
16 typedef pthread_mutex_t omp_lock_t;
17 typedef struct { pthread_mutex_t lock; int count; void *owner; } omp_nest_lock_t;
18 #else
19 typedef sem_t omp_lock_t;
20 typedef struct { sem_t lock; int count; void *owner; } omp_nest_lock_t;
21 #endif