Browse Source

tests/: initialize mutex and cond variables

Nathalie Furmento 14 years ago
parent
commit
82e08fe3ef
2 changed files with 4 additions and 4 deletions
  1. 2 2
      tests/datawizard/dsm_stress.c
  2. 2 2
      tests/microbenchs/prefetch_data_on_node.c

+ 2 - 2
tests/datawizard/dsm_stress.c

@@ -26,8 +26,8 @@
 
 #define VECTORSIZE	1024
 
-static pthread_mutex_t mutex;
-static pthread_cond_t cond;
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
 
 static unsigned finished = 0;
 

+ 2 - 2
tests/microbenchs/prefetch_data_on_node.c

@@ -26,8 +26,8 @@
 
 #define VECTORSIZE	1024
 
-static pthread_mutex_t mutex;
-static pthread_cond_t cond;
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
 
 static unsigned finished = 0;