[PATCH] libgcc: properly destroy mutexes on VxWorks
Rasmus Villemoes
rv@rasmusvillemoes.dk
Mon Oct 29 13:53:00 GMT 2018
Just as one needs run-time initialization of mutexes, one needs to
destroy them properly to allow the OS to release resources associated
with the semaphore.
==changelog==
libgcc/
* config/gthr-vxworks.h (__gthread_mutex_destroy): Call semDelete.
---
libgcc/config/gthr-vxworks.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libgcc/config/gthr-vxworks.h b/libgcc/config/gthr-vxworks.h
index e43253b01c7..e974aa79368 100644
--- a/libgcc/config/gthr-vxworks.h
+++ b/libgcc/config/gthr-vxworks.h
@@ -63,8 +63,9 @@ __gthread_mutex_init_function (__gthread_mutex_t *mutex)
}
static inline int
-__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
{
+ semDelete(*mutex);
return 0;
}
--
2.19.1.6.gbde171bbf5
More information about the Gcc-patches
mailing list