00001 /* This header is used during the build process to find the size and 00002 alignment of the public OpenMP locks, so that we can export data 00003 structures without polluting the namespace. 00004 00005 In this default POSIX implementation, we used to map the two locks to the 00006 same PTHREADS primitive, but for OpenMP 3.0 sem_t needs to be used 00007 instead, as pthread_mutex_unlock should not be called by different 00008 thread than the one that called pthread_mutex_lock. */ 00009 00010 #include <pthread.h> 00011 #include <semaphore.h> 00012 00013 typedef pthread_mutex_t omp_lock_25_t; 00014 typedef struct { pthread_mutex_t lock; int count; } omp_nest_lock_25_t; 00015 #ifdef HAVE_BROKEN_POSIX_SEMAPHORES 00016 /* If we don't have working semaphores, we'll make all explicit tasks 00017 tied to the creating thread. */ 00018 typedef pthread_mutex_t omp_lock_t; 00019 typedef struct { pthread_mutex_t lock; int count; void *owner; } omp_nest_lock_t; 00020 #else 00021 typedef sem_t omp_lock_t; 00022 typedef struct { sem_t lock; int count; void *owner; } omp_nest_lock_t; 00023 #endif