From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 3779E3858D38; Mon, 3 Oct 2022 14:33:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3779E3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664807588; bh=kwTfb4DMwIZi4eCkJzAN3s5TqLLJhIpw5kkXCmRhkTI=; h=From:To:Subject:Date:From; b=CazYoHD2QH5ikC02/xVnE//+VBF2zZKrOggCN/4FothnOoEr4yyWubtFThegDsR1k QrHCXPg8IejdWUvl9OVEeTOecZ5Y/YjRInpd3bNcLCFJiYqaPIJqB/JdRH/jf6sLkE XXqBYnLVAtoK2lOnk8UMd1eNDrL+rYVOdguSf4oc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] support: Add xpthread_cond_signal wrapper X-Act-Checkin: glibc X-Git-Author: Yu Chien Peter Lin X-Git-Refname: refs/heads/master X-Git-Oldrev: b7bd94068e55d5fa8681e2ab4802d31852ea404e X-Git-Newrev: 3bea50ccbc925d4fc5f85ec402b6154cbe770b71 Message-Id: <20221003143308.3779E3858D38@sourceware.org> Date: Mon, 3 Oct 2022 14:33:08 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3bea50ccbc925d4fc5f85ec402b6154cbe770b71 commit 3bea50ccbc925d4fc5f85ec402b6154cbe770b71 Author: Yu Chien Peter Lin Date: Fri Sep 30 20:19:50 2022 +0800 support: Add xpthread_cond_signal wrapper Signed-off-by: Yu Chien Peter Lin Reviewed-by: Adhemerval Zanella Diff: --- support/Makefile | 1 + support/xpthread_cond_signal.c | 26 ++++++++++++++++++++++++++ support/xthread.h | 1 + 3 files changed, 28 insertions(+) diff --git a/support/Makefile b/support/Makefile index 551d02941f..4046b12fbd 100644 --- a/support/Makefile +++ b/support/Makefile @@ -159,6 +159,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 index 0000000000..ed0be1a8ab --- /dev/null +++ b/support/xpthread_cond_signal.c @@ -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 + . */ + +#include + +void +xpthread_cond_signal (pthread_cond_t *cond) +{ + xpthread_check_return + ("pthread_cond_signal", pthread_cond_signal (cond)); +} diff --git a/support/xthread.h b/support/xthread.h index af06715f46..ae09649325 100644 --- a/support/xthread.h +++ b/support/xthread.h @@ -62,6 +62,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);