Переглянути джерело

We cannot put a task into a bundle after its submission.

Cédric Augonnet 14 роки тому
батько
коміт
904fd13997
1 змінених файлів з 8 додано та 0 видалено
  1. 8 0
      src/core/task_bundle.c

+ 8 - 0
src/core/task_bundle.c

@@ -68,6 +68,14 @@ int starpu_task_bundle_insert(struct starpu_task_bundle *bundle, struct starpu_t
 		return -EPERM;
 	}
 
+	if (task->status != STARPU_TASK_INVALID)
+	{
+		/* the task has already been submitted, it's too late to put it
+		 * into a bundle now. */
+		PTHREAD_MUTEX_UNLOCK(&bundle->mutex);
+		return -EINVAL;
+	}
+
 	/* Insert a task at the end of the bundle */
 	struct starpu_task_bundle_entry *entry;
 	entry = malloc(sizeof(struct starpu_task_bundle_entry));