11.1Sjmmv/* $NetBSD: h_exit.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */ 21.1Sjmmv 31.1Sjmmv/* 41.1Sjmmv * Copyright (c) 2008 The NetBSD Foundation, Inc. 51.1Sjmmv * All rights reserved. 61.1Sjmmv * 71.1Sjmmv * Redistribution and use in source and binary forms, with or without 81.1Sjmmv * modification, are permitted provided that the following conditions 91.1Sjmmv * are met: 101.1Sjmmv * 1. Redistributions of source code must retain the above copyright 111.1Sjmmv * notice, this list of conditions and the following disclaimer. 121.1Sjmmv * 2. Redistributions in binary form must reproduce the above copyright 131.1Sjmmv * notice, this list of conditions and the following disclaimer in the 141.1Sjmmv * documentation and/or other materials provided with the distribution. 151.1Sjmmv * 161.1Sjmmv * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 171.1Sjmmv * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 181.1Sjmmv * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 191.1Sjmmv * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 201.1Sjmmv * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 211.1Sjmmv * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 221.1Sjmmv * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 231.1Sjmmv * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 241.1Sjmmv * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 251.1Sjmmv * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 261.1Sjmmv * POSSIBILITY OF SUCH DAMAGE. 271.1Sjmmv */ 281.1Sjmmv 291.1Sjmmv#include <sys/cdefs.h> 301.1Sjmmv__COPYRIGHT("@(#) Copyright (c) 2008\ 311.1Sjmmv The NetBSD Foundation, inc. All rights reserved."); 321.1Sjmmv__RCSID("$NetBSD: h_exit.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $"); 331.1Sjmmv 341.1Sjmmv#include <stdio.h> 351.1Sjmmv#include <stdlib.h> 361.1Sjmmv#include <pthread.h> 371.1Sjmmv 381.1Sjmmvint 391.1Sjmmvmain(void) 401.1Sjmmv{ 411.1Sjmmv printf("Test of pthread_exit() in main thread only.\n"); 421.1Sjmmv 431.1Sjmmv pthread_exit(NULL); 441.1Sjmmv 451.1Sjmmv printf("You shouldn't see this."); 461.1Sjmmv exit(1); 471.1Sjmmv} 48