ソースを参照

Make sure to wait for the thread which woke us and let us destroy the job

Samuel Thibault 13 年 前
コミット
7e7a40d54e
共有1 個のファイルを変更した4 個の追加0 個の削除を含む
  1. 4 0
      src/core/jobs.c

+ 4 - 0
src/core/jobs.c

@@ -106,6 +106,10 @@ struct _starpu_job* __attribute__((malloc)) _starpu_job_create(struct starpu_tas
 
 void _starpu_job_destroy(struct _starpu_job *j)
 {
+	/* Wait for any code that was still working on the job (and was
+	 * probably our waker) */
+	_STARPU_PTHREAD_MUTEX_LOCK(&j->sync_mutex);
+	_STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 	_STARPU_PTHREAD_COND_DESTROY(&j->sync_cond);
 	_STARPU_PTHREAD_MUTEX_DESTROY(&j->sync_mutex);