Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/socketvar.h
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | KASSERT(SOLISTENING(sol), \ | ||||
("%s: %p not listening", __func__, (sol))); \ | ("%s: %p not listening", __func__, (sol))); \ | ||||
mtx_unlock(&(sol)->so_lock); \ | mtx_unlock(&(sol)->so_lock); \ | ||||
} while (0) | } while (0) | ||||
#define SOLISTEN_LOCK_ASSERT(sol) do { \ | #define SOLISTEN_LOCK_ASSERT(sol) do { \ | ||||
mtx_assert(&(sol)->so_lock, MA_OWNED); \ | mtx_assert(&(sol)->so_lock, MA_OWNED); \ | ||||
KASSERT(SOLISTENING(sol), \ | KASSERT(SOLISTENING(sol), \ | ||||
("%s: %p not listening", __func__, (sol))); \ | ("%s: %p not listening", __func__, (sol))); \ | ||||
} while (0) | } while (0) | ||||
#define SOLISTEN_UNLOCK_ASSERT(sol) do { \ | |||||
mtx_assert(&(sol)->so_lock, MA_NOTOWNED); \ | |||||
KASSERT(SOLISTENING(sol), \ | |||||
("%s: %p not listening", __func__, (sol))); \ | |||||
} while (0) | |||||
/* | /* | ||||
* Socket buffer locks. These are strongly preferred over SOCKBUF_LOCK(sb) | * Socket buffer locks. These are strongly preferred over SOCKBUF_LOCK(sb) | ||||
* macros, as we are moving towards protocol specific socket buffers. | * macros, as we are moving towards protocol specific socket buffers. | ||||
*/ | */ | ||||
#define SOCK_RECVBUF_MTX(so) \ | #define SOCK_RECVBUF_MTX(so) \ | ||||
(&(so)->so_rcv_mtx) | (&(so)->so_rcv_mtx) | ||||
#define SOCK_RECVBUF_LOCK(so) \ | #define SOCK_RECVBUF_LOCK(so) \ | ||||
▲ Show 20 Lines • Show All 337 Lines • Show Last 20 Lines |