Преглед на файлове

Initialize submitted_mutex mutex before avoiding to start watchdog thread since other threads will still try to acquire it

Samuel Thibault преди 10 години
родител
ревизия
ee72ee8e06
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      src/core/task.c

+ 3 - 2
src/core/task.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2014  Université de Bordeaux
+ * Copyright (C) 2009-2015  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011, 2014  INRIA
@@ -1165,10 +1165,11 @@ void _starpu_watchdog_init(void)
 	struct _starpu_machine_config *config = (struct _starpu_machine_config *)_starpu_get_machine_config();
 	char *timeout_env = getenv("STARPU_WATCHDOG_TIMEOUT");
 
+	STARPU_PTHREAD_MUTEX_INIT(&config->submitted_mutex, NULL);
+
 	if (!timeout_env)
 		return;
 
-	STARPU_PTHREAD_MUTEX_INIT(&config->submitted_mutex, NULL);
 	STARPU_PTHREAD_CREATE(&watchdog_thread, NULL, watchdog_func, timeout_env);
 }