diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-01-09 05:00:41 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-01-09 05:00:41 +0000 |
commit | a6ab698ab0edb8e7baa3a6a732e387823f1c3dcd (patch) | |
tree | 4fd6402fc00deda5073cdd5d8a3074dacec8f007 /sys/netipx/ipx_pcb.c | |
parent | dbe7c51df6abf448367f1b6dd6785e0cc8b5815b (diff) | |
download | FreeBSD-src-a6ab698ab0edb8e7baa3a6a732e387823f1c3dcd.zip FreeBSD-src-a6ab698ab0edb8e7baa3a6a732e387823f1c3dcd.tar.gz |
Introduce a global mutex, ipxpcb_list_mtx, to protect the global
IPX PCB lists. Add macros to initialize, destroy, lock, unlock,
and assert the mutex. Initialize the mutex when IPX is started.
Add per-IPX PCB mutexes, ipxp_mtx in struct ipxpcb, to protect
per-PCB IPX/SPX state. Add macros to initialize, destroy, lock,
unlock, and assert the mutex. Initialize the mutex when a new
PCB is allocated; destroy it when the PCB is free'd.
MFC after: 2 weeks
Diffstat (limited to 'sys/netipx/ipx_pcb.c')
-rw-r--r-- | sys/netipx/ipx_pcb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netipx/ipx_pcb.c b/sys/netipx/ipx_pcb.c index 1649b2e..322e569 100644 --- a/sys/netipx/ipx_pcb.c +++ b/sys/netipx/ipx_pcb.c @@ -66,6 +66,7 @@ ipx_pcballoc(so, head, td) MALLOC(ipxp, struct ipxpcb *, sizeof *ipxp, M_PCB, M_NOWAIT | M_ZERO); if (ipxp == NULL) return (ENOBUFS); + IPX_LOCK_INIT(ipxp); ipxp->ipxp_socket = so; if (ipxcksum) ipxp->ipxp_flags |= IPXP_CHECKSUM; @@ -277,6 +278,7 @@ ipx_pcbdetach(ipxp) if (ipxp->ipxp_route.ro_rt != NULL) RTFREE(ipxp->ipxp_route.ro_rt); LIST_REMOVE(ipxp, ipxp_list); + IPX_LOCK_DESTROY(ipxp); FREE(ipxp, M_PCB); } |