Add mutex for routing entries.

Reviewed by:	bmilekic, silby
This commit is contained in:
Jeffrey Hsu 2003-07-19 00:21:13 +00:00
parent 121d81b884
commit 1ebe998675

View file

@ -113,7 +113,7 @@ struct rtentry {
struct rtentry *);
/* output routine for this (rt,if) */
struct rtentry *rt_parent; /* cloning parent of this route */
void *rt_filler2; /* more filler */
struct mtx *rt_mtx; /* mutex for routing entry */
};
/*
@ -262,6 +262,13 @@ struct route_cb {
};
#ifdef _KERNEL
#define RT_LOCK_INIT(rt) \
mtx_init((rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK)
#define RT_LOCK(rt) mtx_lock((rt)->rt_mtx)
#define RT_UNLOCK(rt) mtx_unlock((rt)->rt_mtx)
#define RT_LOCK_DESTROY(rt) mtx_destroy((rt)->rt_mtx)
#define RTFREE(rt) \
do { \
if ((rt)->rt_refcnt <= 1) \