]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Add xpthread_cond_signal wrapper
authorYu Chien Peter Lin <peterlin@andestech.com>
Fri, 30 Sep 2022 12:19:50 +0000 (20:19 +0800)
committerSunil K Pandey <skpgkp2@gmail.com>
Sat, 11 Jan 2025 22:59:17 +0000 (14:59 -0800)
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 3bea50ccbc925d4fc5f85ec402b6154cbe770b71)

support/Makefile
support/xpthread_cond_signal.c [new file with mode: 0644]
support/xthread.h

index 6f4b7e4b45094496f20091147bc0c679fbaed636..0a25d5962fdb638a266ed696e92262362d3fe04e 100644 (file)
@@ -157,6 +157,7 @@ libsupport-routines = \
   xpthread_cancel \
   xpthread_check_return \
   xpthread_cond_wait \
+  xpthread_cond_signal \
   xpthread_create \
   xpthread_detach \
   xpthread_join \
diff --git a/support/xpthread_cond_signal.c b/support/xpthread_cond_signal.c
new file mode 100644 (file)
index 0000000..ed0be1a
--- /dev/null
@@ -0,0 +1,26 @@
+/* pthread_cond_signal with error checking.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <support/xthread.h>
+
+void
+xpthread_cond_signal (pthread_cond_t *cond)
+{
+  xpthread_check_return
+    ("pthread_cond_signal", pthread_cond_signal (cond));
+}
index a4a4ec5b1ef16fd35fcaa1fca7caa07cf7eff5be..1a39b1c0ddda97258622aeaf7476f4768341c547 100644 (file)
@@ -58,6 +58,7 @@ void xpthread_mutex_consistent (pthread_mutex_t *);
 void xpthread_spin_lock (pthread_spinlock_t *lock);
 void xpthread_spin_unlock (pthread_spinlock_t *lock);
 void xpthread_cond_wait (pthread_cond_t * cond, pthread_mutex_t * mutex);
+void xpthread_cond_signal (pthread_cond_t *cond);
 pthread_t xpthread_create (pthread_attr_t *attr,
                            void *(*thread_func) (void *), void *closure);
 void xpthread_detach (pthread_t thr);