source: trunk/sys/libgomp/include/omp-lock.h @ 251

Last change on this file since 251 was 1, checked in by alain, 8 years ago

First import

File size: 1.0 KB
Line 
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 default POSIX implementation, we used to map the two locks to the
6   same PTHREADS primitive, but for OpenMP 3.0 sem_t needs to be used
7   instead, as pthread_mutex_unlock should not be called by different
8   thread than the one that called pthread_mutex_lock.  */
9
10#include <pthread.h>
11#include <semaphore.h>
12
13
14
15typedef pthread_mutex_t omp_lock_25_t;
16typedef struct { pthread_mutex_t lock; int count; } omp_nest_lock_25_t;
17#ifdef HAVE_BROKEN_POSIX_SEMAPHORES
18/* If we don't have working semaphores, we'll make all explicit tasks
19   tied to the creating thread.  */
20typedef pthread_mutex_t omp_lock_t;
21typedef struct { pthread_mutex_t lock; int count; void *owner; } omp_nest_lock_t;
22#else
23#ifndef _LIBGOMP_OMP_LOCK_DEFINED
24#define _LIBGOMP_OMP_LOCK_DEFINED 1
25typedef sem_t omp_lock_t;
26typedef struct { sem_t lock; int count; void *owner; } omp_nest_lock_t;
27#endif
28#endif
Note: See TracBrowser for help on using the repository browser.