+// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+//
+// SPDX-License-Identifier: GPL-2.0-or-later
+
/*
- * test_urcu_hash.c
- *
* Userspace RCU library - test program
- *
- * Copyright 2009-2012 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test_urcu_hash.h"
struct cds_lfht *test_ht;
-volatile int test_go, test_stop;
-
unsigned long wdelay;
unsigned long duration;
{
if (caa_unlikely(key1_len != key2_len))
return -1;
- assert(key1_len == sizeof(unsigned long));
+ urcu_posix_assert(key1_len == sizeof(unsigned long));
if (key1 == key2)
return 0;
else
int ret;
ret = cds_lfht_del(test_ht, cds_lfht_iter_get_node(&iter));
- assert(!ret);
+ urcu_posix_assert(!ret);
call_rcu(&node->head, free_node_cb);
count++;
}
*/
rcu_register_thread();
ret = (get_populate_hash_cb())();
- assert(!ret);
+ urcu_posix_assert(!ret);
rcu_thread_offline();
cmm_smp_mb();
- test_go = 1;
+ begin_test();
remain = duration;
do {
remain = sleep(remain);
} while (remain > 0);
- test_stop = 1;
+ end_test();
end_pthread_join:
for (i_thr = 0; i_thr < nr_readers_created; i_thr++) {