瀏覽代碼

get starpu_get_changing_ctx_mutex out of the public API

Andra Hugo 12 年之前
父節點
當前提交
2400b6829a
共有 4 個文件被更改,包括 5 次插入5 次删除
  1. 0 3
      include/starpu_sched_ctx.h
  2. 1 1
      src/core/sched_ctx.c
  3. 3 0
      src/core/sched_ctx.h
  4. 1 1
      src/core/sched_policy.c

+ 0 - 3
include/starpu_sched_ctx.h

@@ -48,9 +48,6 @@ void starpu_sched_ctx_delete(unsigned sched_ctx_id);
 /* indicate which context whill inherit the resources of this context when he will be deleted */
 void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor);
 
-/* mutex synchronising several simultaneous modifications of a context */
-starpu_pthread_mutex_t* starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id);
-
 /* indicate that the current thread is submitting only to the current context */
 void starpu_sched_ctx_set_context(unsigned *sched_ctx_id);
 

+ 1 - 1
src/core/sched_ctx.c

@@ -885,7 +885,7 @@ int starpu_get_workers_of_sched_ctx(unsigned sched_ctx_id, int *pus, enum starpu
 	return npus;
 }
 
-starpu_pthread_mutex_t* starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id)
+starpu_pthread_mutex_t* _starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id)
 {
 	return &changing_ctx_mutex[sched_ctx_id];
 }

+ 3 - 0
src/core/sched_ctx.h

@@ -144,6 +144,9 @@ void _starpu_worker_gets_out_of_ctx(unsigned sched_ctx_id, struct _starpu_worker
 /* Check if the worker belongs to another sched_ctx */
 unsigned _starpu_worker_belongs_to_a_sched_ctx(int workerid, unsigned sched_ctx_id);
 
+/* mutex synchronising several simultaneous modifications of a context */
+starpu_pthread_mutex_t* _starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id);
+
 #ifdef STARPU_USE_SC_HYPERVISOR
 /* Notifies the hypervisor that a tasks was poped from the workers' list */
 void _starpu_sched_ctx_call_poped_task_cb(int workerid, struct starpu_task *task, size_t data_size, uint32_t footprint);

+ 1 - 1
src/core/sched_policy.c

@@ -397,7 +397,7 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
 	{
 		STARPU_ASSERT(sched_ctx->sched_policy->push_task);
 		/* check out if there are any workers in the context */
-		starpu_pthread_mutex_t *changing_ctx_mutex = starpu_sched_ctx_get_changing_ctx_mutex(sched_ctx->id);
+		starpu_pthread_mutex_t *changing_ctx_mutex = _starpu_sched_ctx_get_changing_ctx_mutex(sched_ctx->id);
 		_STARPU_PTHREAD_MUTEX_LOCK(changing_ctx_mutex);
 		nworkers = starpu_sched_ctx_get_nworkers(sched_ctx->id);
 		ret = nworkers == 0 ? -1 : sched_ctx->sched_policy->push_task(task);