diff options
author | Tobias Weingartner <weingart@cvs.openbsd.org> | 2009-04-25 20:14:44 +0000 |
---|---|---|
committer | Tobias Weingartner <weingart@cvs.openbsd.org> | 2009-04-25 20:14:44 +0000 |
commit | 63236ac1c42847c6bcc02c8acb7093ae39774ff5 (patch) | |
tree | 8cb2a2f6f6bd68a9532e6eb57af0df12c6ede76d /sys/arch/hppa64 | |
parent | 7cd46f20cc6a6ba8a5bf692f17ccd7d9571b6bbb (diff) |
Enter mtx_enter_try. In part for completeness, things may start
using this soon(ish). Ok oga@, sorta yes kettenis@.
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r-- | sys/arch/hppa64/hppa64/mutex.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/hppa64/hppa64/mutex.c b/sys/arch/hppa64/hppa64/mutex.c index 6fe5b0aa415..93b8f9836c1 100644 --- a/sys/arch/hppa64/hppa64/mutex.c +++ b/sys/arch/hppa64/hppa64/mutex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.c,v 1.1 2007/10/06 14:54:38 kettenis Exp $ */ +/* $OpenBSD: mutex.c,v 1.2 2009/04/25 20:14:42 weingart Exp $ */ /* * Copyright (c) 2004 Artur Grabowski <art@openbsd.org> @@ -54,6 +54,17 @@ mtx_enter(struct mutex *mtx) mtx->mtx_lock = 1; } +int +mtx_enter_try(struct mutex *mtx) +{ + if (mtx->mtx_wantipl != IPL_NONE) + mtx->mtx_oldipl = _splraise(mtx->mtx_wantipl); + MUTEX_ASSERT_UNLOCKED(mtx); + mtx->mtx_lock = 1; + + return 1; +} + void mtx_leave(struct mutex *mtx) { |