mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Clean up warnings in pthread tests
I intend to move these into lib/libthr/tests/ and connect to kyua. This is a first step to address warnings emitted when building using standard make infrastructure. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34306
This commit is contained in:
parent
1581ec9a45
commit
ef135466f8
|
@ -32,14 +32,14 @@
|
|||
|
||||
#define NLOOPS 10
|
||||
|
||||
pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
|
||||
pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
|
||||
static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
|
||||
|
||||
int wake;
|
||||
int stop;
|
||||
static int wake;
|
||||
static int stop;
|
||||
|
||||
void *
|
||||
thr_routine(void *arg)
|
||||
static void *
|
||||
thr_routine(void *arg __unused)
|
||||
{
|
||||
pthread_mutex_lock(&m);
|
||||
while (wake == 0)
|
||||
|
@ -51,7 +51,7 @@ thr_routine(void *arg)
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc __unused, char **argv __unused)
|
||||
{
|
||||
pthread_t td;
|
||||
int i;
|
||||
|
|
|
@ -46,7 +46,7 @@ thread(void *arg)
|
|||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
main(int argc __unused, char *argv[] __unused)
|
||||
{
|
||||
pthread_t thr;
|
||||
pthread_mutex_t mtx;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* $FreeBSD$ */
|
||||
|
||||
int destructed;
|
||||
int destructed2;
|
||||
static int destructed;
|
||||
static int destructed2;
|
||||
|
||||
class Test {
|
||||
public:
|
||||
|
@ -10,7 +10,7 @@ class Test {
|
|||
};
|
||||
|
||||
void
|
||||
cleanup_handler(void *arg)
|
||||
cleanup_handler(void *arg __unused)
|
||||
{
|
||||
destructed2 = 1;
|
||||
printf("%s()\n", __func__);
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int caught;
|
||||
static int caught;
|
||||
|
||||
void *
|
||||
thr_routine(void *arg)
|
||||
static void *
|
||||
thr_routine(void *arg __unused)
|
||||
{
|
||||
try {
|
||||
pthread_exit(NULL);
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
|
||||
#include "Test.cpp"
|
||||
|
||||
pthread_mutex_t mtx;
|
||||
pthread_cond_t cv;
|
||||
static pthread_mutex_t mtx;
|
||||
static pthread_cond_t cv;
|
||||
|
||||
void *
|
||||
thr(void *arg)
|
||||
static void *
|
||||
thr(void *arg __unused)
|
||||
{
|
||||
Test t;
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
|
||||
#include "Test.cpp"
|
||||
|
||||
pthread_mutex_t mtx;
|
||||
pthread_cond_t cv;
|
||||
static pthread_mutex_t mtx;
|
||||
static pthread_cond_t cv;
|
||||
|
||||
void f()
|
||||
static void f()
|
||||
{
|
||||
Test t;
|
||||
|
||||
|
@ -26,13 +26,13 @@ void f()
|
|||
printf("Bug, thread shouldn't be here.\n");
|
||||
}
|
||||
|
||||
void g()
|
||||
static void g()
|
||||
{
|
||||
f();
|
||||
}
|
||||
|
||||
void *
|
||||
thr(void *arg)
|
||||
static void *
|
||||
thr(void *arg __unused)
|
||||
{
|
||||
pthread_cleanup_push(cleanup_handler, NULL);
|
||||
g();
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
#include "Test.cpp"
|
||||
|
||||
sem_t sem;
|
||||
static sem_t sem;
|
||||
|
||||
void *
|
||||
thr(void *arg)
|
||||
static void *
|
||||
thr(void *arg __unused)
|
||||
{
|
||||
Test t;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include "Test.cpp"
|
||||
|
||||
void *
|
||||
thr_routine(void *arg)
|
||||
static void *
|
||||
thr_routine(void *arg __unused)
|
||||
{
|
||||
Test test;
|
||||
|
||||
|
|
Loading…
Reference in a new issue