Pass -shared when linking some shared libraries
[openafs.git] / src / crypto / hcrypto / heim_threads.h
1 #ifdef AFS_PTHREAD_ENV
2 #include <pthread.h>
3
4 #define HEIMDAL_MUTEX pthread_mutex_t
5 #define HEIMDAL_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
6 #define HEIMDAL_MUTEX_init(m) pthread_mutex_init(m, NULL)
7 #define HEIMDAL_MUTEX_lock(m) pthread_mutex_lock(m)
8 #define HEIMDAL_MUTEX_unlock(m) pthread_mutex_unlock(m)
9 #define HEIMDAL_MUTEX_destroy(m) pthread_mutex_destroy(m)
10 #else
11 /* The one location in hcrypto which uses mutexes is the PRNG
12  * code. As this code takes no locks, never yields, and does no
13  * I/O through the LWP IO Manager, it cannot be pre-empted, so
14  * it is safe to simply remove the locks in this case
15  */
16 #define HEIMDAL_MUTEX int
17 #define HEIMDAL_MUTEX_INITIALIZER 0
18 #define HEIMDAL_MUTEX_init(m) do { (void)(m); } while(0)
19 #define HEIMDAL_MUTEX_lock(m) do { (void)(m); } while(0)
20 #define HEIMDAL_MUTEX_unlock(m) do { (void)(m); } while(0)
21 #define HEIMDAL_MUTEX_destroy(m) do { (void)(m); } while(0)
22 #endif
23