Просмотр исходного кода

Check sched_mutex rule before releasing the mutex, in case releasing the mutex actually leads to seeing something freed that is used to access to the mutex (e.g. an index)

Samuel Thibault лет назад: 8
Родитель
Сommit
4fbf3e23d7
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      include/starpu_thread_util.h

+ 2 - 2
include/starpu_thread_util.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2010, 2012-2014, 2016  Université de Bordeaux
+ * Copyright (C) 2010, 2012-2014, 2016-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013  CNRS
  * Copyright (C) 2010, 2011, 2012, 2013  CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * StarPU is free software; you can redistribute it and/or modify
@@ -130,6 +130,7 @@ int _starpu_pthread_mutex_trylock_sched(starpu_pthread_mutex_t *mutex, char *fil
 }
 }
 
 
 #define STARPU_PTHREAD_MUTEX_UNLOCK(mutex) do {                               \
 #define STARPU_PTHREAD_MUTEX_UNLOCK(mutex) do {                               \
+	_STARPU_CHECK_NOT_SCHED_MUTEX(mutex, __FILE__, __LINE__);              \
 	int p_ret = starpu_pthread_mutex_unlock(mutex);                        \
 	int p_ret = starpu_pthread_mutex_unlock(mutex);                        \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \
 		fprintf(stderr,                                                \
 		fprintf(stderr,                                                \
@@ -137,7 +138,6 @@ int _starpu_pthread_mutex_trylock_sched(starpu_pthread_mutex_t *mutex, char *fil
 			__FILE__, __LINE__, strerror(p_ret));                  \
 			__FILE__, __LINE__, strerror(p_ret));                  \
 		STARPU_ABORT();                                                \
 		STARPU_ABORT();                                                \
 	}                                                                      \
 	}                                                                      \
-	_STARPU_CHECK_NOT_SCHED_MUTEX(mutex, __FILE__, __LINE__);                                  \
 } while (0)
 } while (0)
 
 
 #define STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(mutex) do {                          \
 #define STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(mutex) do {                          \