opnsense-src/tools/regression/pthread/unwind/thread_normal_exit.cpp
Ed Maste ef135466f8 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
2022-02-16 16:28:31 -05:00

28 lines
407 B
C++

/* $FreeBSD$ */
/* test stack unwinding for a new thread */
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include "Test.cpp"
static void *
thr_routine(void *arg __unused)
{
Test test;
pthread_exit(NULL);
printf("Bug, thread shouldn't be here\n");
}
int
main()
{
pthread_t td;
pthread_create(&td, NULL, thr_routine, NULL);
pthread_join(td, NULL);
check_destruct();
return (0);
}