X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Furcu%2Fstatic%2Fwfqueue.h;h=731b43f71a3be5d65967d981511f2baf9a513fec;hb=d3d3857f678627e7bbfb5a8d6f3bc15cd2a694d9;hp=df9f62f28bafa189a5b2f0d61fcbfce8b978b7b4;hpb=6893800a4d1cc14dff0395ddcd660a5138db183d;p=urcu.git diff --git a/include/urcu/static/wfqueue.h b/include/urcu/static/wfqueue.h index df9f62f..731b43f 100644 --- a/include/urcu/static/wfqueue.h +++ b/include/urcu/static/wfqueue.h @@ -1,34 +1,20 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WFQUEUE_STATIC_H #define _URCU_WFQUEUE_STATIC_H /* - * wfqueue-static.h - * * Userspace RCU library - Queue with Wait-Free Enqueue/Blocking Dequeue * * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See wfqueue.h for linking * dynamically with the userspace rcu library. - * - * Copyright 2010 - Mathieu Desnoyers - * - * 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 */ #include -#include #include +#include #include #include @@ -62,13 +48,13 @@ static inline void _cds_wfq_init(struct cds_wfq_queue *q) q->head = &q->dummy; q->tail = &q->dummy.next; ret = pthread_mutex_init(&q->lock, NULL); - assert(!ret); + urcu_posix_assert(!ret); } static inline void _cds_wfq_destroy(struct cds_wfq_queue *q) { int ret = pthread_mutex_destroy(&q->lock); - assert(!ret); + urcu_posix_assert(!ret); } static inline void _cds_wfq_enqueue(struct cds_wfq_queue *q, @@ -157,10 +143,10 @@ _cds_wfq_dequeue_blocking(struct cds_wfq_queue *q) int ret; ret = pthread_mutex_lock(&q->lock); - assert(!ret); + urcu_posix_assert(!ret); retnode = ___cds_wfq_dequeue_blocking(q); ret = pthread_mutex_unlock(&q->lock); - assert(!ret); + urcu_posix_assert(!ret); return retnode; }