Add lwkt_sleep() to formalize a shortcut numerous bits of code have been
commit53108ea4da178531d38335123976d82bda4ebed2
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 May 2007 20:51:22 +0000 (24 20:51 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 May 2007 20:51:22 +0000 (24 20:51 +0000)
tree9c4304adc05976946dd33becf965fe199376586f
parent285b6ed7d6599aa7305062827ecc4afc5ccc089d
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