Merge with trank @ 137446
[official-gcc.git] / libgomp / config / posix95 / omp-lock.h
blobb542ba13192324b34d39b62097eee8af7d716589
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.
5 In this POSIX95 implementation, we map the two locks to the
6 same PTHREADS primitive. */
8 #include <pthread.h>
9 #include <semaphore.h>
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