Browse Source

Bugfix: examples/cg/cg.c should not fail with "pthread_mutex_unlock: invalid mutex" any more.

This reverts the first chunk of r5489.
Cyril Roelandt 13 years ago
parent
commit
54725d8d1f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/core/dependencies/cg.c

+ 2 - 1
src/core/dependencies/cg.c

@@ -2,6 +2,7 @@
  *
  * Copyright (C) 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012 inria
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -196,7 +197,7 @@ void _starpu_notify_cg_list(struct _starpu_cg_list *successors)
 			unsigned must_destroy_task = 0;
 			struct starpu_task *task = j->task;
 
-			if (j->terminated > 0 && task->destroy && task->detach)
+			if (j->submitted && j->terminated > 0 && task->destroy && task->detach)
 				must_destroy_task = 1;
 
 			_STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);