Parcourir la source

starpu_sched_ctx_worker_shares_tasks_lists is called from add_workers which already has sched_mutex taken

Olivier Aumage il y a 8 ans
Parent
commit
6d4e7daa4d
1 fichiers modifiés avec 1 ajouts et 10 suppressions
  1. 1 10
      src/core/sched_ctx.c

+ 1 - 10
src/core/sched_ctx.c

@@ -192,20 +192,11 @@ void starpu_sched_ctx_stop_task_submission()
 	STARPU_ASSERT(!ret);
 }
 
+/* must be called with sched_mutex locked */
 void starpu_sched_ctx_worker_shares_tasks_lists(int workerid, int sched_ctx_id)
 {
 	struct _starpu_worker *worker = _starpu_get_worker_struct(workerid);
-	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
-	int curr_workerid = starpu_worker_get_id();
-	/* if is the initial sched_ctx no point in taking the mutex, the workers are
-	   not launched yet, or if the current worker is calling this */
-	if(!sched_ctx->is_initial_sched && workerid != curr_workerid)
-		STARPU_PTHREAD_MUTEX_LOCK_SCHED(&worker->sched_mutex);
-
 	worker->shares_tasks_lists[sched_ctx_id] = 1;
-
-	if(!sched_ctx->is_initial_sched && workerid != curr_workerid)
-		STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(&worker->sched_mutex);
 }
 
 static void _starpu_add_workers_to_sched_ctx(struct _starpu_sched_ctx *sched_ctx, int *workerids, int nworkers,