Browse Source

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

Nathalie Furmento 10 years ago
parent
commit
e3a6b31d7e
1 changed files with 1 additions and 0 deletions
  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");