X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=lfstack.c;fp=lfstack.c;h=74ffd4f053e655e5e8392a35b8c27a74b6d4d0e5;hp=0000000000000000000000000000000000000000;hb=d3bfcb24240b01619686641ddd92ae8222b3ad32;hpb=69328034b804a0fc180c08f7ca6be1a4446bb105 diff --git a/lfstack.c b/lfstack.c new file mode 100644 index 0000000..74ffd4f --- /dev/null +++ b/lfstack.c @@ -0,0 +1,51 @@ +/* + * lfstack.c + * + * Userspace RCU library - Lock-Free Stack + * + * Copyright 2010-2012 - 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 + */ + +/* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ +#undef _LGPL_SOURCE +#include "urcu/lfstack.h" +#define _LGPL_SOURCE +#include "urcu/static/lfstack.h" + +/* + * library wrappers to be used by non-LGPL compatible source code. + */ + +void cds_lfs_node_init(struct cds_lfs_node *node) +{ + _cds_lfs_node_init(node); +} + +void cds_lfs_init(struct cds_lfs_stack *s) +{ + _cds_lfs_init(s); +} + +int cds_lfs_push(struct cds_lfs_stack *s, struct cds_lfs_node *node) +{ + return _cds_lfs_push(s, node); +} + +struct cds_lfs_node *cds_lfs_pop(struct cds_lfs_stack *s) +{ + return _cds_lfs_pop(s); +}