소스 검색

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);
 }