Explorar o código

src/core/workers.c: fail when number of calls to starpu_shutdown() is higher than the number of calls to starpu_init()

Nathalie Furmento %!s(int64=10) %!d(string=hai) anos
pai
achega
e3a6b31d7e
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/core/workers.c

+ 1 - 0
src/core/workers.c

@@ -1420,6 +1420,7 @@ void starpu_shutdown(void)
 {
 	STARPU_PTHREAD_MUTEX_LOCK(&init_mutex);
 	init_count--;
+	STARPU_ASSERT_MSG(init_count >= 0, "Number of calls to starpu_shutdown() can not be higher than the number of calls to starpu_init()\n");
 	if (init_count)
 	{
 		_STARPU_DEBUG("Still somebody needing StarPU, don't deinitialize\n");