From 9ba1f9fa381dcbfb861533fdda13f9f27da78f14 Mon Sep 17 00:00:00 2001 From: deischen Date: Fri, 24 May 2002 04:32:28 +0000 Subject: Revamp suspend and resume. While I'm here add pthread_suspend_all_np() and pthread_resume_all_np(). These suspend and resume all threads except the current thread, respectively. The existing functions pthread_single_np() and pthread_multi_np(), which formerly had no effect, now exhibit the same behaviour and pthread_suspend_all_np() and pthread_resume_all_np(). These functions have been added mostly for the native java port. Don't allow the uthread kernel pipe to use the same descriptors as stdio. Mostily submitted by Oswald Buddenhagen . Correct some minor style nits. --- lib/libpthread/thread/thr_single_np.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/libpthread/thread/thr_single_np.c') diff --git a/lib/libpthread/thread/thr_single_np.c b/lib/libpthread/thread/thr_single_np.c index 85471b8..1ee5e79 100644 --- a/lib/libpthread/thread/thr_single_np.c +++ b/lib/libpthread/thread/thr_single_np.c @@ -31,17 +31,19 @@ * * $FreeBSD$ */ -#include #include -#include "pthread_private.h" +#include __weak_reference(_pthread_single_np, pthread_single_np); int _pthread_single_np() { - struct pthread *curthread = _get_curthread(); /* Enter single-threaded (non-POSIX) scheduling mode: */ - _thread_single = curthread; - return(0); + pthread_suspend_all_np(); + /* + * XXX - Do we want to do this? + * __is_threaded = 0; + */ + return (0); } -- cgit v1.1