libgcc: properly destroy mutexes on VxWorks
authorRasmus Villemoes <rv@rasmusvillemoes.dk>
Tue, 30 Oct 2018 08:33:04 +0000 (09:33 +0100)
committerRasmus Villemoes <villemoes@gcc.gnu.org>
Tue, 30 Oct 2018 08:33:04 +0000 (08:33 +0000)
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.

From-SVN: r265616

libgcc/ChangeLog
libgcc/config/gthr-vxworks.h

index 44fe7327ca41c7e4208ecae1cd09afc1bb992002..1be4f87fe65cf922fcb06693cb8544307ffab601 100644 (file)
@@ -1,3 +1,7 @@
+2018-10-30  Rasmus Villemoes  <rv@rasmusvillemoes.dk>
+
+       * config/gthr-vxworks.h (__gthread_mutex_destroy): Call semDelete.
+
 2018-10-25  Martin Liska  <mliska@suse.cz>
 
        PR other/87735
index e43253b01c7800d81db553f42ee8f1d081f2fcfb..e974aa793680b5928ce750929c4a8015074306a0 100644 (file)
@@ -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;
 }