Add a LOCK_INITIALIZER() macro to statically initialize a struct lock.

This commit is contained in:
thorpej 2003-06-13 05:13:43 +00:00
parent 93695b73fb
commit c4b3abedc3
1 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.h,v 1.47 2003/01/18 09:53:19 thorpej Exp $ */
/* $NetBSD: lock.h,v 1.48 2003/06/13 05:13:43 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -172,6 +172,17 @@ struct lock {
#endif
};
#define LOCK_INITIALIZER(prio, wmesg, timo, flags) \
{ SIMPLELOCK_INITIALIZER, \
(flags), \
0, \
0, \
0, \
0, \
(wmesg), \
{ .lk_un_sleep = { 0, 0, (prio), (timo) } } \
}
/*
* Lock request types:
* LK_SHARED - get one of many possible shared locks. If a process