From 63236ac1c42847c6bcc02c8acb7093ae39774ff5 Mon Sep 17 00:00:00 2001 From: Tobias Weingartner Date: Sat, 25 Apr 2009 20:14:44 +0000 Subject: Enter mtx_enter_try. In part for completeness, things may start using this soon(ish). Ok oga@, sorta yes kettenis@. --- sys/arch/hppa64/hppa64/mutex.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/arch/hppa64') 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 @@ -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) { -- cgit v1.2.3