Przeglądaj źródła

Simplify code a bit

Samuel Thibault 8 lat temu
rodzic
commit
8baea5bd02
1 zmienionych plików z 2 dodań i 4 usunięć
  1. 2 4
      src/core/workers.h

+ 2 - 4
src/core/workers.h

@@ -952,11 +952,9 @@ static inline void __starpu_worker_relax_on(const char*file, int line, const cha
 static inline void _starpu_worker_relax_on(void)
 #endif
 {
-	int workerid = starpu_worker_get_id();
-	if (workerid == -1)
+	struct _starpu_worker *worker = _starpu_get_local_worker_key();
+	if (worker == NULL)
 		return;
-	struct _starpu_worker *worker = _starpu_get_worker_struct(workerid);
-	STARPU_ASSERT(worker != NULL);
 	if (!worker->state_sched_op_pending)
 		return;
 	STARPU_PTHREAD_MUTEX_LOCK_SCHED(&worker->sched_mutex);