fix: handle EINTR correctly in get_cpu_mask_from_sysfs
[urcu.git] / tests / benchmark / test_urcu_hash.c
index 8838bc097130b065faeddaf78ec3fefa16c6092d..606851baf37ee1b5a84e63b9e8c3cbe3e2a74e48 100644 (file)
@@ -1,23 +1,9 @@
+// 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"
@@ -96,8 +82,6 @@ DEFINE_URCU_TLS(unsigned long, lookup_ok);
 
 struct cds_lfht *test_ht;
 
-volatile int test_go, test_stop;
-
 unsigned long wdelay;
 
 unsigned long duration;
@@ -192,7 +176,7 @@ unsigned long test_compare(const void *key1, size_t key1_len,
 {
        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
@@ -258,7 +242,7 @@ void test_delete_all_nodes(struct cds_lfht *ht)
                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++;
        }
@@ -599,7 +583,7 @@ int main(int argc, char **argv)
         */
        rcu_register_thread();
        ret = (get_populate_hash_cb())();
-       assert(!ret);
+       urcu_posix_assert(!ret);
 
        rcu_thread_offline();
 
@@ -649,14 +633,14 @@ int main(int argc, char **argv)
 
        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++) {
This page took 0.025494 seconds and 4 git commands to generate.