|
@@ -109,10 +109,15 @@ int starpu_task_bundle_remove(starpu_task_bundle_t bundle, struct starpu_task *t
|
|
|
{
|
|
|
struct _starpu_task_bundle_entry *item;
|
|
|
|
|
|
+ _STARPU_PTHREAD_MUTEX_LOCK(&bundle->mutex);
|
|
|
+
|
|
|
item = bundle->list;
|
|
|
|
|
|
if (!item)
|
|
|
+ {
|
|
|
+ _STARPU_PTHREAD_MUTEX_UNLOCK(&bundle->mutex);
|
|
|
return -ENOENT;
|
|
|
+ }
|
|
|
|
|
|
STARPU_ASSERT(task->bundle == bundle);
|
|
|
task->bundle = NULL;
|
|
@@ -131,6 +136,7 @@ int starpu_task_bundle_remove(starpu_task_bundle_t bundle, struct starpu_task *t
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ _STARPU_PTHREAD_MUTEX_UNLOCK(&bundle->mutex);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -143,6 +149,7 @@ int starpu_task_bundle_remove(starpu_task_bundle_t bundle, struct starpu_task *t
|
|
|
{
|
|
|
|
|
|
item->next = next->next;
|
|
|
+ _STARPU_PTHREAD_MUTEX_UNLOCK(&bundle->mutex);
|
|
|
free(next);
|
|
|
return 0;
|
|
|
}
|
|
@@ -150,6 +157,8 @@ int starpu_task_bundle_remove(starpu_task_bundle_t bundle, struct starpu_task *t
|
|
|
item = next;
|
|
|
}
|
|
|
|
|
|
+ _STARPU_PTHREAD_MUTEX_UNLOCK(&bundle->mutex);
|
|
|
+
|
|
|
|
|
|
return -ENOENT;
|
|
|
}
|
|
@@ -320,6 +329,8 @@ double starpu_task_bundle_expected_data_transfer_time(starpu_task_bundle_t bundl
|
|
|
entry = entry->next;
|
|
|
}
|
|
|
|
|
|
+ _STARPU_PTHREAD_MUTEX_UNLOCK(&bundle->mutex);
|
|
|
+
|
|
|
|
|
|
|
|
|
double total_exp = 0.0;
|
|
@@ -337,7 +348,5 @@ double starpu_task_bundle_expected_data_transfer_time(starpu_task_bundle_t bundl
|
|
|
free(current);
|
|
|
}
|
|
|
|
|
|
- _STARPU_PTHREAD_MUTEX_UNLOCK(&bundle->mutex);
|
|
|
-
|
|
|
return total_exp;
|
|
|
}
|