diff options
author | mav <mav@FreeBSD.org> | 2014-01-22 23:51:12 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-01-22 23:51:12 +0000 |
commit | 695b5b9179f2f608ff6042914c460cc75dc11519 (patch) | |
tree | 5419eeab7a2baed05f1ecc4daeba3a78189fa04b /sys/rpc/svc.c | |
parent | ec416d0ab84b2e916ae2498d35cf43ef91370909 (diff) | |
download | FreeBSD-src-695b5b9179f2f608ff6042914c460cc75dc11519.zip FreeBSD-src-695b5b9179f2f608ff6042914c460cc75dc11519.tar.gz |
MFC r260036:
Introduce xprt_inactive_self() -- variant for use when sure that port
is assigned to thread. For example, withing receive handlers. In that
case the function reduces to single assignment and can avoid locking.
Diffstat (limited to 'sys/rpc/svc.c')
-rw-r--r-- | sys/rpc/svc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index 96d011a..f63300d 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -406,6 +406,19 @@ xprt_inactive(SVCXPRT *xprt) } /* + * Variant of xprt_inactive() for use only when sure that port is + * assigned to thread. For example, withing receive handlers. + */ +void +xprt_inactive_self(SVCXPRT *xprt) +{ + + KASSERT(xprt->xp_thread != NULL, + ("xprt_inactive_self(%p) with NULL xp_thread", xprt)); + xprt->xp_active = FALSE; +} + +/* * Add a service program to the callout list. * The dispatch routine will be called when a rpc request for this * program number comes in. |