From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from Atcsqr.andestech.com (60-248-80-70.hinet-ip.hinet.net [60.248.80.70]) by sourceware.org (Postfix) with ESMTPS id 8266D3858D1E for ; Fri, 30 Sep 2022 12:20:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8266D3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andestech.com Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 28UCKGEZ080033; Fri, 30 Sep 2022 20:20:16 +0800 (+08) (envelope-from peterlin@andestech.com) Received: from atcfdc88.andestech.com (10.0.15.120) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Fri, 30 Sep 2022 20:20:14 +0800 From: Yu Chien Peter Lin To: CC: , , , , Yu Chien Peter Lin Subject: [PATCH v2 1/2] support: Add xpthread_cond_signal wrapper Date: Fri, 30 Sep 2022 20:19:50 +0800 Message-ID: <20220930121951.30671-1-peterlin@andestech.com> X-Mailer: git-send-email 2.34.1.390.g2ae0a9cb82 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.0.15.120] X-DNSRBL: X-MAIL:Atcsqr.andestech.com 28UCKGEZ080033 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_SHORT,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Signed-off-by: Yu Chien Peter Lin --- support/Makefile | 1 + support/xpthread_cond_signal.c | 26 ++++++++++++++++++++++++++ support/xthread.h | 1 + 3 files changed, 28 insertions(+) create mode 100644 support/xpthread_cond_signal.c 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); -- 2.34.1