init pthread mutexes only if an initializer exists

and windows has none

Change-Id: Iaff3047abde197791e3fbb42c12066f896e540d1
Reviewed-on: http://gerrit.openafs.org/1169
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Derrick Brashear 2010-01-27 12:58:49 -05:00 committed by Jeffrey Altman
parent 900dc5b31b
commit c51e266183
2 changed files with 15 additions and 3 deletions

View File

@ -50,7 +50,11 @@ static int is_inited = 0;
*/
#include <assert.h>
pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t des_init_mutex
#ifdef PTHREAD_MUTEX_INITIALIZER
= PTHREAD_MUTEX_INITIALIZER
#endif
;
#define LOCK_INIT assert(pthread_mutex_lock(&des_init_mutex)==0)
#define UNLOCK_INIT assert(pthread_mutex_unlock(&des_init_mutex)==0)
#else
@ -189,7 +193,11 @@ static unsigned char sequence_number[8];
*/
#include <assert.h>
pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t des_random_mutex
#ifdef PTHREAD_MUTEX_INITIALIZER
= PTHREAD_MUTEX_INITIALIZER
#endif
;
#define LOCK_RANDOM assert(pthread_mutex_lock(&des_random_mutex)==0)
#define UNLOCK_RANDOM assert(pthread_mutex_unlock(&des_random_mutex)==0)
#else

View File

@ -78,7 +78,11 @@ static fc_KeySchedule random_int32_schedule;
*/
#include <assert.h>
pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t rxkad_random_mutex
#ifdef PTHREAD_MUTEX_INITIALIZER
= PTHREAD_MUTEX_INITIALIZER
#endif
;
#define LOCK_RM assert(pthread_mutex_lock(&rxkad_random_mutex)==0)
#define UNLOCK_RM assert(pthread_mutex_unlock(&rxkad_random_mutex)==0)
#else