|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
*
|
|
|
- * Copyright (C) 2010-2016 Université de Bordeaux
|
|
|
+ * Copyright (C) 2010-2017 Université de Bordeaux
|
|
|
* Copyright (C) 2010-2013, 2016 CNRS
|
|
|
*
|
|
|
* StarPU is free software; you can redistribute it and/or modify
|
|
@@ -118,8 +118,14 @@ static struct starpu_task *pop_task_dummy(unsigned sched_ctx_id)
|
|
|
* the calling worker. So we just take the head of the list and give it
|
|
|
* to the worker. */
|
|
|
struct dummy_sched_data *data = (struct dummy_sched_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
|
|
|
+#ifdef STARPU_NON_BLOCKING_DRIVERS
|
|
|
+ if (starpu_task_list_empty(&data->sched_list))
|
|
|
+ return NULL;
|
|
|
+#endif
|
|
|
STARPU_PTHREAD_MUTEX_LOCK(&data->policy_mutex);
|
|
|
- struct starpu_task *task = starpu_task_list_pop_back(&data->sched_list);
|
|
|
+ struct starpu_task *task = NULL;
|
|
|
+ if (!starpu_task_list_empty(&data->sched_list))
|
|
|
+ task = starpu_task_list_pop_back(&data->sched_list);
|
|
|
STARPU_PTHREAD_MUTEX_UNLOCK(&data->policy_mutex);
|
|
|
return task;
|
|
|
}
|