瀏覽代碼

src: make sure we use starpu_pthread type

Nathalie Furmento 11 年之前
父節點
當前提交
7c066359c0
共有 2 個文件被更改,包括 4 次插入6 次删除
  1. 2 2
      src/core/workers.h
  2. 2 4
      src/drivers/mp_common/source_common.c

+ 2 - 2
src/core/workers.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -135,7 +135,7 @@ struct _starpu_combined_worker
 	int combined_workerid[STARPU_NMAXWORKERS];
 #ifdef STARPU_USE_MP
 	int count;
-	pthread_mutex_t count_mutex;
+	starpu_pthread_mutex_t count_mutex;
 #endif
 
 #ifdef __GLIBC__

+ 2 - 4
src/drivers/mp_common/source_common.c

@@ -16,8 +16,6 @@
 
 
 #include <string.h>
-#include <pthread.h>
-
 #include <starpu.h>
 #include <core/task.h>
 #include <core/sched_policy.h>
@@ -46,11 +44,11 @@ static int _starpu_src_common_finalize_job (struct _starpu_job *j, struct _starp
 	{
 		struct _starpu_combined_worker * cb_worker = _starpu_get_combined_worker_struct(worker->combined_workerid); 
 
-		pthread_mutex_lock(&cb_worker->count_mutex);
+		starpu_pthread_mutex_lock(&cb_worker->count_mutex);
 		count = cb_worker->count--;
 		if(count == 0)
 			cb_worker->count = cb_worker->worker_size - 1; 
-		pthread_mutex_unlock(&cb_worker->count_mutex);
+		starpu_pthread_mutex_unlock(&cb_worker->count_mutex);
 	}
 
 	/* Finalize the execution */