sx.9 (169777) | sx.9 (169780) |
---|---|
1.\" 2.\" Copyright (C) 2001 Jason Evans <jasone@FreeBSD.org>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice(s), this list of conditions and the following disclaimer as --- 10 unchanged lines hidden (view full) --- 19.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 25.\" DAMAGE. 26.\" | 1.\" 2.\" Copyright (C) 2001 Jason Evans <jasone@FreeBSD.org>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice(s), this list of conditions and the following disclaimer as --- 10 unchanged lines hidden (view full) --- 19.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 25.\" DAMAGE. 26.\" |
27.\" $FreeBSD: head/share/man/man9/sx.9 169777 2007-05-19 20:24:32Z jhb $ | 27.\" $FreeBSD: head/share/man/man9/sx.9 169780 2007-05-19 21:26:05Z jhb $ |
28.\" 29.Dd February 1, 2006 30.Dt SX 9 31.Os 32.Sh NAME 33.Nm sx , 34.Nm sx_init , 35.Nm sx_init_flags , --- 159 unchanged lines hidden (view full) --- 195the 196.Fn sx_assert 197function tests 198.Fa sx 199for the assertions specified in 200.Fa what , 201and panics if they are not met. 202One of the following assertions must be specified: | 28.\" 29.Dd February 1, 2006 30.Dt SX 9 31.Os 32.Sh NAME 33.Nm sx , 34.Nm sx_init , 35.Nm sx_init_flags , --- 159 unchanged lines hidden (view full) --- 195the 196.Fn sx_assert 197function tests 198.Fa sx 199for the assertions specified in 200.Fa what , 201and panics if they are not met. 202One of the following assertions must be specified: |
203.Bl -tag -width ".Dv SX_UNLOCKED" 204.It Dv SX_LOCKED | 203.Bl -tag -width ".Dv SA_UNLOCKED" 204.It Dv SA_LOCKED |
205Assert that the current thread has either a shared or an exclusive lock on the 206.Vt sx 207lock pointed to by the first argument. | 205Assert that the current thread has either a shared or an exclusive lock on the 206.Vt sx 207lock pointed to by the first argument. |
208.It Dv SX_SLOCKED | 208.It Dv SA_SLOCKED |
209Assert that the current thread has a shared lock on the 210.Vt sx 211lock pointed to by 212the first argument. | 209Assert that the current thread has a shared lock on the 210.Vt sx 211lock pointed to by 212the first argument. |
213.It Dv SX_XLOCKED | 213.It Dv SA_XLOCKED |
214Assert that the current thread has an exclusive lock on the 215.Vt sx 216lock pointed to 217by the first argument. | 214Assert that the current thread has an exclusive lock on the 215.Vt sx 216lock pointed to 217by the first argument. |
218.It Dv SX_UNLOCKED | 218.It Dv SA_UNLOCKED |
219Assert that the current thread has no lock on the 220.Vt sx 221lock pointed to 222by the first argument. 223.El 224.Pp 225In addition, one of the following optional assertions may be included with 226either an | 219Assert that the current thread has no lock on the 220.Vt sx 221lock pointed to 222by the first argument. 223.El 224.Pp 225In addition, one of the following optional assertions may be included with 226either an |
227.Dv SX_LOCKED , 228.Dv SX_SLOCKED , | 227.Dv SA_LOCKED , 228.Dv SA_SLOCKED , |
229or | 229or |
230.Dv SX_XLOCKED | 230.Dv SA_XLOCKED |
231assertion: | 231assertion: |
232.Bl -tag -width ".Dv SX_NOTRECURSED" 233.It Dv SX_RECURSED | 232.Bl -tag -width ".Dv SA_NOTRECURSED" 233.It Dv SA_RECURSED |
234Assert that the current thread has a recursed lock on 235.Fa sx . | 234Assert that the current thread has a recursed lock on 235.Fa sx . |
236.It Dv SX_NOTRECURSED | 236.It Dv SA_NOTRECURSED |
237Assert that the current thread does not have a recursed lock on 238.Fa sx . 239.El 240.Pp 241.Fn sx_xholder 242will return a pointer to the thread which currently holds an exclusive lock on 243.Fa sx . 244If no thread holds an exclusive lock on --- 56 unchanged lines hidden (view full) --- 301Currently there is no way to assert that a lock is not held. 302This is not possible in the 303.No non- Ns Dv WITNESS 304case for asserting that this thread 305does not hold a shared lock. 306In the 307.No non- Ns Dv WITNESS 308case, the | 237Assert that the current thread does not have a recursed lock on 238.Fa sx . 239.El 240.Pp 241.Fn sx_xholder 242will return a pointer to the thread which currently holds an exclusive lock on 243.Fa sx . 244If no thread holds an exclusive lock on --- 56 unchanged lines hidden (view full) --- 301Currently there is no way to assert that a lock is not held. 302This is not possible in the 303.No non- Ns Dv WITNESS 304case for asserting that this thread 305does not hold a shared lock. 306In the 307.No non- Ns Dv WITNESS 308case, the |
309.Dv SX_LOCKED | 309.Dv SA_LOCKED |
310and | 310and |
311.Dv SX_SLOCKED | 311.Dv SA_SLOCKED |
312assertions merely check that some thread holds a shared lock. 313They do not ensure that the current thread holds a shared lock. | 312assertions merely check that some thread holds a shared lock. 313They do not ensure that the current thread holds a shared lock. |