thr_single_np.c revision 157457
197403Sobrien/*
297403Sobrien * Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>.
3117397Skan * All rights reserved.
497403Sobrien *
597403Sobrien * Redistribution and use in source and binary forms, with or without
697403Sobrien * modification, are permitted provided that the following conditions
797403Sobrien * are met:
897403Sobrien * 1. Redistributions of source code must retain the above copyright
997403Sobrien *    notice, this list of conditions and the following disclaimer.
1097403Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1197403Sobrien *    notice, this list of conditions and the following disclaimer in the
1297403Sobrien *    documentation and/or other materials provided with the distribution.
1397403Sobrien * 3. All advertising materials mentioning features or use of this software
1497403Sobrien *    must display the following acknowledgement:
1597403Sobrien *	This product includes software developed by John Birrell.
1697403Sobrien * 4. Neither the name of the author nor the names of any co-contributors
1797403Sobrien *    may be used to endorse or promote products derived from this software
1897403Sobrien *    without specific prior written permission.
1997403Sobrien *
2097403Sobrien * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
2197403Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2297403Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2397403Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2497403Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25103447Skan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2697403Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2797403Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2897403Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2997403Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30103447Skan * SUCH DAMAGE.
3197403Sobrien *
32117397Skan * $FreeBSD: head/lib/libthr/thread/thr_single_np.c 157457 2006-04-04 02:57:49Z davidxu $
33117397Skan */
3497403Sobrien
3597403Sobrien#include "namespace.h"
3697403Sobrien#include <pthread.h>
3797403Sobrien#include <pthread_np.h>
38117397Skan#include "un-namespace.h"
39117397Skan
40117397Skan__weak_reference(_pthread_single_np, pthread_single_np);
41117397Skan
42117397Skanint _pthread_single_np()
43117397Skan{
44117397Skan
45117397Skan	/* Enter single-threaded (non-POSIX) scheduling mode: */
46117397Skan	_pthread_suspend_all_np();
47117397Skan	/*
4897403Sobrien	 * XXX - Do we want to do this?
4997403Sobrien	 * __is_threaded = 0;
5097403Sobrien	 */
5197403Sobrien	return (0);
5297403Sobrien}
5397403Sobrien