comparison libgomp/config/posix95/omp-lock.h @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
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