summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_threadstuff.h
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2011-05-02 01:07:24 +0000
committermrg <mrg@NetBSD.org>2011-05-02 01:07:24 +0000
commit21dc7181bb1b8cdf1881c270440ffa414ff187fc (patch)
treebaf145c25989aa830803d44202cc28eca58383e4 /sys/dev/raidframe/rf_threadstuff.h
parent152a051ebdd3d06398cb5c8c04cae953c6782396 (diff)
re-apply the reverted previous, after fixing the missed wakeup:
convert eq_mutex to a kmutex/cv. convert ltsleep() used for plain timeout into kpause().
Diffstat (limited to 'sys/dev/raidframe/rf_threadstuff.h')
-rw-r--r--sys/dev/raidframe/rf_threadstuff.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/dev/raidframe/rf_threadstuff.h b/sys/dev/raidframe/rf_threadstuff.h
index ecbd710da00..c957f3121db 100644
--- a/sys/dev/raidframe/rf_threadstuff.h
+++ b/sys/dev/raidframe/rf_threadstuff.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_threadstuff.h,v 1.28 2011/05/02 00:39:37 mrg Exp $ */
+/* $NetBSD: rf_threadstuff.h,v 1.29 2011/05/02 01:07:24 mrg Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -75,21 +75,24 @@ typedef void *RF_ThreadArg_t;
/* Modern mutex */
/* Note that rf_declare_{mutex,cond}2() do _NOT_ append the ; */
-#define rf_declare_mutex2(_m_) kmutex_t _m_
-#define rf_declare_cond2(_c_) kcondvar_t _c_
+#define rf_declare_mutex2(_m_) kmutex_t _m_
+#define rf_declare_cond2(_c_) kcondvar_t _c_
-#define rf_lock_mutex2(_m_) mutex_enter(&(_m_))
-#define rf_unlock_mutex2(_m_) mutex_exit(&(_m_))
+#define rf_lock_mutex2(_m_) mutex_enter(&(_m_))
+#define rf_unlock_mutex2(_m_) mutex_exit(&(_m_))
-#define rf_init_mutex2(_m_, _p_) mutex_init(&(_m_), MUTEX_DEFAULT, (_p_))
-#define rf_destroy_mutex2(_m_) mutex_destroy(&(_m_))
+#define rf_init_mutex2(_m_, _p_) mutex_init(&(_m_), MUTEX_DEFAULT, (_p_))
+#define rf_destroy_mutex2(_m_) mutex_destroy(&(_m_))
-#define rf_init_cond2(_c_, _w_) cv_init(&(_c_), (_w_))
-#define rf_destroy_cond2(_c_) cv_destroy(&(_c_))
+#define rf_init_cond2(_c_, _w_) cv_init(&(_c_), (_w_))
+#define rf_destroy_cond2(_c_) cv_destroy(&(_c_))
+
+#define rf_wait_cond2(_c_,_m_) cv_wait(&(_c_), &(_m_))
+#define rf_timedwait_cond2(_c_,_m_,_t_) cv_timedwait(&(_c_), &(_m_), (_t_))
+#define rf_signal_cond2(_c_) cv_signal(&(_c_))
+#define rf_broadcast_cond2(_c_) cv_broadcast(&(_c_))
-#define rf_wait_cond2(_c_,_m_) cv_wait(&(_c_), &(_m_))
-#define rf_signal_cond2(_c_) cv_signal(&(_c_))
-#define rf_broadcast_cond2(_c_) cv_broadcast(&(_c_))
+#define rf_sleep(_w_,_t_,_m_) kpause((_w_), false, (_t_), &(_m_))
/*
* In NetBSD, kernel threads are simply processes which share several