diff options
author | rwatson <rwatson@FreeBSD.org> | 2008-12-08 20:18:50 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2008-12-08 20:18:50 +0000 |
commit | 9010318345e58def3a559ec0d3682e75e3f9cc56 (patch) | |
tree | 44fab8651dee89cfe2a941cd1c54d63825fecb96 /lib/libc/stdio/tmpnam.c | |
parent | bc7e5e240b9981c969b0971946e2a372896de290 (diff) | |
download | FreeBSD-src-9010318345e58def3a559ec0d3682e75e3f9cc56.zip FreeBSD-src-9010318345e58def3a559ec0d3682e75e3f9cc56.tar.gz |
Add a reference count to struct inpcb, which may be explicitly
incremented using in_pcbref(), and decremented using in_pcbfree()
or inpcbrele(). Protocols using only current in_pcballoc() and
in_pcbfree() calls will see the same semantics, but it is now
possible for TCP to call in_pcbref() and in_pcbrele() to prevent
an inpcb from being freed when both tcbinfo and per-inpcb locks
are released. This makes it possible to safely transition from
holding only the inpcb lock to both tcbinfo and inpcb lock
without re-looking up a connection in the input path, timer
path, etc.
Notice that in_pcbrele() does not unlock the connection after
decrementing the refcount, if the connection remains, so that
the caller can continue to use it; in_pcbrele() returns a flag
indicating whether or not the inpcb pointer is still valid, and
in_pcbfee() is now a simple wrapper around in_pcbrele().
MFC after: 1 month
Discussed with: bz, kmacy
Reviewed by: bz, gnn, kmacy
Tested by: kmacy
Diffstat (limited to 'lib/libc/stdio/tmpnam.c')
0 files changed, 0 insertions, 0 deletions