netisr barrier: Avoid lockless wakeup/tsleep race
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 31 Jan 2011 03:09:35 +0000 (11:09 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 31 Jan 2011 03:09:35 +0000 (11:09 +0800)
commitca3321f80921e6398c9aa5a4c00811086e981d76
treef7bfa609d2ffb7fe33fa7a5cab85c0e3e225e7bd
parent4bcc2b127c70c86b8ebb27f3241896d67a030004
netisr barrier: Avoid lockless wakeup/tsleep race

Add a waiting state (NETISR_BR_WAITDONE), before it is set wakeup()
will not be called.  And use atomic_cmpset_int() to do the state
transition.

With-help-from: dillon@
sys/net/netisr.c