浏览代码

workers: turn function starpu_worker_set_flag_sched_mutex_locked private and hence rename it as _starpu_worker_set_flag_sched_mutex_locked

Nathalie Furmento 11 年之前
父节点
当前提交
4a14f59a24
共有 4 个文件被更改,包括 9 次插入8 次删除
  1. 1 3
      include/starpu_worker.h
  2. 4 3
      src/common/thread.c
  3. 2 2
      src/core/workers.c
  4. 2 0
      src/core/workers.h

+ 1 - 3
include/starpu_worker.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010-2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010-2014  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
  * it under the terms of the GNU Lesser General Public License as published by
@@ -107,8 +107,6 @@ int starpu_worker_get_mp_nodeid(int id);
 
 
 int starpu_worker_get_nsched_ctxs(int workerid);
 int starpu_worker_get_nsched_ctxs(int workerid);
 
 
-void starpu_worker_set_flag_sched_mutex_locked(int workerid, unsigned flag);
-
 unsigned starpu_worker_mutex_is_sched_mutex(int workerid, starpu_pthread_mutex_t *mutex);
 unsigned starpu_worker_mutex_is_sched_mutex(int workerid, starpu_pthread_mutex_t *mutex);
 
 
 struct starpu_tree* starpu_workers_get_tree(void);
 struct starpu_tree* starpu_workers_get_tree(void);

+ 4 - 3
src/common/thread.c

@@ -17,6 +17,7 @@
 
 
 #include <starpu.h>
 #include <starpu.h>
 #include <core/simgrid.h>
 #include <core/simgrid.h>
+#include <core/workers.h>
 
 
 #ifdef STARPU_SIMGRID
 #ifdef STARPU_SIMGRID
 #include <xbt/synchro_core.h>
 #include <xbt/synchro_core.h>
@@ -337,7 +338,7 @@ int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex)
 	int p_ret = pthread_mutex_lock(mutex);
 	int p_ret = pthread_mutex_lock(mutex);
 	int workerid = starpu_worker_get_id();
 	int workerid = starpu_worker_get_id();
 	if(workerid != -1 && starpu_worker_mutex_is_sched_mutex(workerid, mutex))
 	if(workerid != -1 && starpu_worker_mutex_is_sched_mutex(workerid, mutex))
-		starpu_worker_set_flag_sched_mutex_locked(workerid, 1);	 
+		_starpu_worker_set_flag_sched_mutex_locked(workerid, 1);	 
 
 
 	_STARPU_TRACE_MUTEX_LOCKED();
 	_STARPU_TRACE_MUTEX_LOCKED();
 
 
@@ -351,7 +352,7 @@ int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex)
 	int p_ret = pthread_mutex_unlock(mutex);
 	int p_ret = pthread_mutex_unlock(mutex);
 	int workerid = starpu_worker_get_id(); 
 	int workerid = starpu_worker_get_id(); 
 	if(workerid != -1 && starpu_worker_mutex_is_sched_mutex(workerid, mutex)) 
 	if(workerid != -1 && starpu_worker_mutex_is_sched_mutex(workerid, mutex)) 
-		starpu_worker_set_flag_sched_mutex_locked(workerid, 0);	
+		_starpu_worker_set_flag_sched_mutex_locked(workerid, 0);	
 
 
 	_STARPU_TRACE_MUTEX_UNLOCKED();
 	_STARPU_TRACE_MUTEX_UNLOCKED();
 
 
@@ -369,7 +370,7 @@ int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex)
 	{
 	{
 		int workerid = starpu_worker_get_id();	
 		int workerid = starpu_worker_get_id();	
 		if(workerid != -1 && starpu_worker_mutex_is_sched_mutex(workerid, mutex)) 
 		if(workerid != -1 && starpu_worker_mutex_is_sched_mutex(workerid, mutex)) 
-			starpu_worker_set_flag_sched_mutex_locked(workerid, 1);
+			_starpu_worker_set_flag_sched_mutex_locked(workerid, 1);
 
 
 		_STARPU_TRACE_MUTEX_LOCKED();
 		_STARPU_TRACE_MUTEX_LOCKED();
 	}
 	}

+ 2 - 2
src/core/workers.c

@@ -1834,7 +1834,7 @@ void _starpu_unlock_mutex_if_prev_locked()
 		if(w->sched_mutex_locked)
 		if(w->sched_mutex_locked)
 		{
 		{
 			STARPU_PTHREAD_MUTEX_UNLOCK(&w->sched_mutex);
 			STARPU_PTHREAD_MUTEX_UNLOCK(&w->sched_mutex);
-			starpu_worker_set_flag_sched_mutex_locked(workerid, 1);
+			_starpu_worker_set_flag_sched_mutex_locked(workerid, 1);
 		}
 		}
 	}
 	}
 	return;
 	return;
@@ -1852,7 +1852,7 @@ void _starpu_relock_mutex_if_prev_locked()
 	return;
 	return;
 }
 }
 
 
-void starpu_worker_set_flag_sched_mutex_locked(int workerid, unsigned flag)
+void _starpu_worker_set_flag_sched_mutex_locked(int workerid, unsigned flag)
 {
 {
 	struct _starpu_worker *w = _starpu_get_worker_struct(workerid);
 	struct _starpu_worker *w = _starpu_get_worker_struct(workerid);
 	w->sched_mutex_locked = flag;
 	w->sched_mutex_locked = flag;

+ 2 - 0
src/core/workers.h

@@ -418,4 +418,6 @@ void _starpu_unlock_mutex_if_prev_locked();
 /* if we prev released the lock relock it */
 /* if we prev released the lock relock it */
 void _starpu_relock_mutex_if_prev_locked();
 void _starpu_relock_mutex_if_prev_locked();
 
 
+void _starpu_worker_set_flag_sched_mutex_locked(int workerid, unsigned flag);
+
 #endif // __WORKERS_H__
 #endif // __WORKERS_H__