diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-07-12 18:39:59 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-07-12 18:39:59 +0000 |
commit | 9183ed533a6a59e2febbded3d383cd619c86b214 (patch) | |
tree | 9b431220526cb46ffec785cb7faee8827c5c49fc /sys/netatalk/ddp_pcb.h | |
parent | d0f3949724322ee8bfcd3f3026b6911ef764e498 (diff) | |
download | FreeBSD-src-9183ed533a6a59e2febbded3d383cd619c86b214.zip FreeBSD-src-9183ed533a6a59e2febbded3d383cd619c86b214.tar.gz |
Procotol control block locking for netatalk DDP.
Diffstat (limited to 'sys/netatalk/ddp_pcb.h')
-rw-r--r-- | sys/netatalk/ddp_pcb.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/netatalk/ddp_pcb.h b/sys/netatalk/ddp_pcb.h index 819d674..85ec0cc 100644 --- a/sys/netatalk/ddp_pcb.h +++ b/sys/netatalk/ddp_pcb.h @@ -1,4 +1,5 @@ /* + * Copyright (c) 2004 Robert N. M. Watson * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * @@ -17,4 +18,23 @@ int at_pcbsetaddr(struct ddpcb *ddp, struct sockaddr *addr, struct thread *td); void at_sockaddr(struct ddpcb *ddp, struct sockaddr **addr); +/* Lock macros for per-pcb locks. */ +#define DDP_LOCK_INIT(ddp) mtx_init(&(ddp)->ddp_mtx, "ddp_mtx", \ + NULL, MTX_DEF) +#define DDP_LOCK_DESTROY(ddp) mtx_destroy(&(ddp)->ddp_mtx) +#define DDP_LOCK(ddp) mtx_lock(&(ddp)->ddp_mtx) +#define DDP_UNLOCK(ddp) mtx_unlock(&(ddp)->ddp_mtx) +#define DDP_LOCK_ASSERT(ddp) mtx_assert(&(ddp)->ddp_mtx, MA_OWNED) + +/* Lock macros for global pcb list lock. */ +#define DDP_LIST_LOCK_INIT() mtx_init(&ddp_list_mtx, "ddp_list_mtx", \ + NULL, MTX_DEF) +#define DDP_LIST_LOCK_DESTROY() mtx_destroy(&ddp_list_mtx) +#define DDP_LIST_XLOCK() mtx_lock(&ddp_list_mtx) +#define DDP_LIST_XUNLOCK() mtx_unlock(&ddp_list_mtx) +#define DDP_LIST_XLOCK_ASSERT() mtx_assert(&ddp_list_mtx, MA_OWNED) +#define DDP_LIST_SLOCK() mtx_lock(&ddp_list_mtx) +#define DDP_LIST_SUNLOCK() mtx_unlock(&ddp_list_mtx) +#define DDP_LIST_SLOCK_ASSERT() mtx_assert(&ddp_list_mtx, MA_OWNED) + #endif |