X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=src%2Furcu-defer-impl.h;h=8b5ad972421d52f523f18146a3a1a068c2bcb661;hp=b5d79262c03bb88a28cd376d78c4189ca3c578cd;hb=HEAD;hpb=879a3e166178d16b2ffedc73899904d52285cfe8 diff --git a/src/urcu-defer-impl.h b/src/urcu-defer-impl.h index b5d7926..a180c48 100644 --- a/src/urcu-defer-impl.h +++ b/src/urcu-defer-impl.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_DEFER_IMPL_H #define _URCU_DEFER_IMPL_H /* - * urcu-defer-impl.h - * * Userspace RCU header - memory reclamation. * * TO BE INCLUDED ONLY FROM URCU LIBRARY CODE. See urcu-defer.h for linking * dynamically with the userspace rcu reclamation library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This 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. - * - * This 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 this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -409,8 +395,18 @@ void defer_rcu(void (*fct)(void *p), void *p) static void start_defer_thread(void) { int ret; + sigset_t newmask, oldmask; + + ret = sigfillset(&newmask); + urcu_posix_assert(!ret); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); + urcu_posix_assert(!ret); ret = pthread_create(&tid_defer, NULL, thr_defer, NULL); + if (ret) + urcu_die(ret); + + ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); urcu_posix_assert(!ret); }