summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread/uthread_kern.c
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1998-11-20 12:13:33 +0000
committerDavid Leonard <d@cvs.openbsd.org>1998-11-20 12:13:33 +0000
commitd5a877b31b8aa64095b3ccba2dadc3f45ba6c88b (patch)
treeefa55bed35e52415146a7a9bf15203ace814b7ac /lib/libc_r/uthread/uthread_kern.c
parentf547068f88348f54941dc06da46491f99701933e (diff)
sync with freebsd
Diffstat (limited to 'lib/libc_r/uthread/uthread_kern.c')
-rw-r--r--lib/libc_r/uthread/uthread_kern.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/libc_r/uthread/uthread_kern.c b/lib/libc_r/uthread/uthread_kern.c
index f2c54f69a51..6f97c2aac65 100644
--- a/lib/libc_r/uthread/uthread_kern.c
+++ b/lib/libc_r/uthread/uthread_kern.c
@@ -29,8 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: uthread_kern.c,v 1.2 1998/11/09 03:13:20 d Exp $
- * $OpenBSD: uthread_kern.c,v 1.2 1998/11/09 03:13:20 d Exp $
+ * $Id: uthread_kern.c,v 1.3 1998/11/20 12:13:32 d Exp $
+ * $OpenBSD: uthread_kern.c,v 1.3 1998/11/20 12:13:32 d Exp $
*
*/
#include <errno.h>
@@ -574,6 +574,7 @@ _thread_kern_sched(struct sigcontext * scp)
* Do a sigreturn to restart the thread that
* was interrupted by a signal:
*/
+ _thread_kern_in_sched = 0;
_thread_sys_sigreturn(&_thread_run->saved_sigcontext);
} else
/*
@@ -605,6 +606,22 @@ _thread_kern_sched_state(enum pthread_state state, const char *fname, int lineno
return;
}
+void
+_thread_kern_sched_state_unlock(enum pthread_state state,
+ spinlock_t *lock, char *fname, int lineno)
+{
+ /* Change the state of the current thread: */
+ _thread_run->state = state;
+ _thread_run->fname = fname;
+ _thread_run->lineno = lineno;
+
+ _SPINUNLOCK(lock);
+
+ /* Schedule the next thread that is ready: */
+ _thread_kern_sched(NULL);
+ return;
+}
+
static void
_thread_kern_select(int wait_reqd)
{