/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2016 Joyent, Inc.
*/
/*
* Validate various C11 threads routines. Specifically we want to cover:
*
* o threads
* o mutexes
* o condition variables
*/
#include <threads.h>
#include <stdlib.h>
#include <unistd.h>
static int stress_count;
/*
* This thread should only ever be used for detach.
*/
static int
{
for (;;) {
sleep(1000);
}
abort();
}
static void
cthr_test_mtx_init(void)
{
mtx_destroy(&mtx);
mtx_destroy(&mtx);
mtx_destroy(&mtx);
mtx_destroy(&mtx);
}
static void
cthr_test_mtx_lockrec(void)
{
mtx_destroy(&mtx);
}
static void
cthr_test_mtx_trylock(void)
{
mtx_destroy(&mtx);
}
static int
{
int i;
for (i = 0; i < STRESS_COUNT; i++) {
}
return (0);
}
static void
cthr_test_stress(void)
{
int i;
for (i = 0; i < STRESS_NTHREADS; i++) {
}
for (i = 0; i < STRESS_NTHREADS; i++) {
}
}
static void
cthr_test_equal(void)
{
self = thrd_current();
}
static void
cthr_test_detach_err(void)
{
self = thrd_current();
}
static int
{
thrd_exit(23);
abort();
}
static int
{
return (42);
}
static void
cthr_test_detach(void)
{
int status;
}
static void
cthr_test_sleep(void)
{
}
static int
{
while (broadcast_done == B_FALSE)
return (0);
}
static void
cthr_test_broadcast(void)
{
int i;
for (i = 0; i < BROADCAST_NTHREADS; i++) {
}
for (i = 0; i < STRESS_NTHREADS; i++) {
}
}
static int
{
while (signal_done == B_FALSE)
return (0);
}
static void
cthr_test_signal(void)
{
int i;
for (i = 0; i < SIGNAL_NTHREADS; i++) {
==, thrd_success);
}
for (i = 0; i < STRESS_NTHREADS; i++) {
}
}
static void
cthr_test_cndtime(void)
{
mtx_destroy(&mtx);
cnd_destroy(&cnd);
}
static void
cthr_test_mtx_selftime(void)
{
mtx_destroy(&mtx);
}
static int
{
return (0);
}
static void
cthr_test_mtx_busy(void)
{
mtx_destroy(&mtx);
}
int
main(void)
{
return (0);
}