Browse Source

- fix the construction of StarPU's OpenMP thread structure for accelerator worker threads, so that the related pthread_setspecific gets performed properly when needed, as part of the get_local_thread() call

Olivier Aumage 10 years ago
parent
commit
0805785a03
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/util/openmp_runtime_support.c

+ 4 - 1
src/util/openmp_runtime_support.c

@@ -473,13 +473,16 @@ static void starpu_omp_explicit_task_exec(void *buffers[], void *cl_arg)
 				new_thread = create_omp_thread_struct(NULL);
 				new_thread->worker = starpu_worker;
 				register_thread_worker(new_thread);
-				thread = new_thread;
+
+				thread = get_local_thread();
+				STARPU_ASSERT(thread == new_thread);
 			}
 			else
 			{
 				_STARPU_ERROR("orphaned CPU thread");
 			}
 		}
+		STARPU_ASSERT(thread != NULL);
 		if (!task->is_untied)
 		{
 			struct _starpu_worker *starpu_worker = _starpu_get_local_worker_key();