diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2009-09-08 05:58:36 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2009-09-08 05:58:36 +0000 |
commit | ec61fdb51658e75daab3b912a20250b46223089b (patch) | |
tree | 972d5dad86f4fd820fc09fc50a92fcf1423e6be2 /share | |
parent | 5463e8c977af7bb27c87fc85efcc34ae2dc4745f (diff) |
another missing bit of mtx_enter_try.
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/mutex.9 | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/share/man/man9/mutex.9 b/share/man/man9/mutex.9 index 4c8f5a21c6f..47687e1cb3b 100644 --- a/share/man/man9/mutex.9 +++ b/share/man/man9/mutex.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mutex.9,v 1.9 2009/05/11 19:49:25 jmc Exp $ +.\" $OpenBSD: mutex.9,v 1.10 2009/09/08 05:58:35 dlg Exp $ .\" .\" Copyright (c) 2005 Pedro Martelletto <pedro@ambientworks.net> .\" All rights reserved. @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 11 2009 $ +.Dd $Mdocdate: September 8 2009 $ .Dt MUTEX 9 .Os .Sh NAME @@ -30,6 +30,8 @@ .Fn mtx_init "struct mutex *mtxp" "int wantipl" .Ft void .Fn mtx_enter "struct mutex *mtxp" +.Ft int +.Fn mtx_enter_try "struct mutex *mtxp" .Ft void .Fn mtx_leave "struct mutex *mtxp" .Sh DESCRIPTION @@ -52,6 +54,12 @@ The function acquires a mutex, spinning if necessary. .Pp The +.Fn mtx_enter_try +function attempts to acquire a mutex. +If it succeeds in acquiring the mutex it will return 1, otherwise +it will return 0. +.Pp +The .Fn mtx_leave function releases a mutex. In case the acquisition of the mutex caused the interrupt level to be changed, |