Skip to content
Snippets Groups Projects
Commit 36267c04 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

add explicit checks to free and destroy mutexes

parent 551a4df9
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,8 @@ void free_store_contents(struct store_t * RESTRICT const store) ...@@ -17,6 +17,8 @@ void free_store_contents(struct store_t * RESTRICT const store)
if(store) if(store)
{ {
#ifdef NUCSYN #ifdef NUCSYN
nucsyn_free_store_contents(store); nucsyn_free_store_contents(store);
#endif #endif
...@@ -85,5 +87,34 @@ void free_store_contents(struct store_t * RESTRICT const store) ...@@ -85,5 +87,34 @@ void free_store_contents(struct store_t * RESTRICT const store)
#endif #endif
free_pulsator_store(store); free_pulsator_store(store);
#ifdef __HAVE_LIBPTHREAD__
/*
* Make mutexes for later locking
*/
pthread_mutex_unlock(&store->lock);
if(pthread_mutex_destroy(&store->lock) != 0)
{
fprintf(stderr,
"\n store->lock mutex destroy failed\n");
}
pthread_mutex_unlock(&store->derivative_map_lock);
if(pthread_mutex_destroy(&store->derivative_map_lock) != 0)
{
fprintf(stderr,
"\n store->derivative_map_lock mutex destroy failed\n");
}
#ifdef MINT
pthread_mutex_unlock(&store->MINT_load_lock);
if(pthread_mutex_destroy(&store->MINT_load_lock) != 0)
{
fprintf(stderr,
"\n store->MINT_load_lock mutex destroy failed\n");
}
#endif//MINT
#endif//__HAVE_LIBPTHREAD__
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment