fix: handle EINTR correctly in get_cpu_mask_from_sysfs
[urcu.git] / tests / benchmark / test_urcu_hash_unique.c
index adbbde0db4f0c59ce751feec00cc4276763c57d3..487baa878e698cc01bad314cd34d5b77cb615fe0 100644 (file)
@@ -1,26 +1,11 @@
+// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+//
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 /*
- * test_urcu_hash_unique.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.
  */
 
-#define _GNU_SOURCE
 #include "test_urcu_hash.h"
 
 enum urcu_hash_addremove {
@@ -31,7 +16,7 @@ enum urcu_hash_addremove {
 
 static enum urcu_hash_addremove addremove; /* 1: add, -1 remove, 0: random */
 
-void test_hash_unique_sigusr1_handler(int signo)
+void test_hash_unique_sigusr1_handler(int signo __attribute__((unused)))
 {
        switch (addremove) {
        case AR_ADD:
@@ -49,7 +34,7 @@ void test_hash_unique_sigusr1_handler(int signo)
        }
 }
 
-void test_hash_unique_sigusr2_handler(int signo)
+void test_hash_unique_sigusr2_handler(int signo __attribute__((unused)))
 {
        char msg[1] = { 0x42 };
        ssize_t ret;
@@ -72,10 +57,7 @@ void *test_hash_unique_thr_reader(void *_count)
 
        rcu_register_thread();
 
-       while (!test_go)
-       {
-       }
-       cmm_smp_mb();
+       wait_until_go();
 
        for (;;) {
                struct lfht_test_node *node;
@@ -137,10 +119,7 @@ void *test_hash_unique_thr_writer(void *_count)
 
        rcu_register_thread();
 
-       while (!test_go)
-       {
-       }
-       cmm_smp_mb();
+       wait_until_go();
 
        for (;;) {
                /*
This page took 0.023677 seconds and 4 git commands to generate.