Add lwkt_sleep() to formalize a shortcut numerous bits of code have been
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 May 2007 20:51:22 +0000 (20:51 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 May 2007 20:51:22 +0000 (20:51 +0000)
commita22c590e24b49fc2f869388af1418c4c152c0566
tree0efd42ee2f9f01c6e503e5fe5bcd873f6ff4eda6
parent2ad39b182574907f901e8814d455663a020d490b
Add lwkt_sleep() to formalize a shortcut numerous bits of code have been
using for a while, which is to directly deschedule oneself and switch away.
This method of blocking requires a direct lwkt_schedule() call to reschedule
the thread and is primarily used by the message port abstraction.

Change the psignal code to check TDF_SINTR in the thread flags instead
of checking MSGPORTF_WAITING in the thread's private message port.

The lwkt_waitmsg() and lwkt_waitport() functions use the same msgport
backend function (mp_waitport).  Separate the backend into two functions,
mp_waitport and mp_waitmsg, and allow tsleep flags to be passed in instead
of flagging interruptability in the lwkt_msg flags.

Optimize the lwkt_waitmsg() backends - in the fully synchronous critical
path case no critical sections or spinlocks are required at all.
12 files changed:
sys/kern/kern_sig.c
sys/kern/kern_synch.c
sys/kern/lwkt_msgport.c
sys/kern/uipc_msg.c
sys/kern/uipc_syscalls.c
sys/net/netisr.c
sys/net/route.c
sys/netinet/if_ether.c
sys/netinet/tcp_usrreq.c
sys/sys/msgport.h
sys/sys/msgport2.h
sys/sys/systm.h