浏览代码

tests/: initialize mutex and cond variables

Nathalie Furmento 14 年之前
父节点
当前提交
82e08fe3ef
共有 2 个文件被更改,包括 4 次插入4 次删除
  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;