Index: kernel/generic/src/synch/condvar.c
===================================================================
--- kernel/generic/src/synch/condvar.c	(revision 8ed4014bd99932e9f124b453fe8252eeda6db443)
+++ kernel/generic/src/synch/condvar.c	(revision 1bb37660771ac9b30c844daebd5d607ac7468abe)
@@ -44,5 +44,5 @@
 /** Initialize condition variable.
  *
- * @param cv Condition variable.
+ * @param cv		Condition variable.
  */
 void condvar_initialize(condvar_t *cv)
@@ -51,9 +51,8 @@
 }
 
-/**
- * Signal the condition has become true
- * to the first waiting thread by waking it up.
+/** Signal the condition has become true to the first waiting thread by waking
+ * it up.
  *
- * @param cv Condition variable.
+ * @param cv		Condition variable.
  */
 void condvar_signal(condvar_t *cv)
@@ -62,9 +61,8 @@
 }
 
-/**
- * Signal the condition has become true
- * to all waiting threads by waking them up.
+/** Signal the condition has become true to all waiting threads by waking
+ * them up.
  *
- * @param cv Condition variable.
+ * @param cv		Condition variable.
  */
 void condvar_broadcast(condvar_t *cv)
@@ -75,15 +73,15 @@
 /** Wait for the condition becoming true.
  *
- * @param cv Condition variable.
- * @param mtx Mutex.
- * @param usec Timeout value in microseconds.
- * @param flags Select mode of operation.
+ * @param cv		Condition variable.
+ * @param mtx		Mutex.
+ * @param usec		Timeout value in microseconds.
+ * @param flags		Select mode of operation.
  *
- * For exact description of meaning of possible combinations
- * of usec and flags, see comment for waitq_sleep_timeout().
- * Note that when SYNCH_FLAGS_NON_BLOCKING is specified here,
- * ESYNCH_WOULD_BLOCK is always returned.
+ * For exact description of meaning of possible combinations of usec and flags,
+ * see comment for waitq_sleep_timeout().  Note that when
+ * SYNCH_FLAGS_NON_BLOCKING is specified here, ESYNCH_WOULD_BLOCK is always
+ * returned.
  *
- * @return See comment for waitq_sleep_timeout().
+ * @return		See comment for waitq_sleep_timeout().
  */
 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags)
Index: kernel/generic/src/synch/mutex.c
===================================================================
--- kernel/generic/src/synch/mutex.c	(revision 8ed4014bd99932e9f124b453fe8252eeda6db443)
+++ kernel/generic/src/synch/mutex.c	(revision 1bb37660771ac9b30c844daebd5d607ac7468abe)
@@ -39,40 +39,52 @@
 #include <synch/semaphore.h>
 #include <synch/synch.h>
+#include <debug.h>
 
-/** Initialize mutex
+/** Initialize mutex.
  *
- * Initialize mutex.
- *
- * @param mtx Mutex.
+ * @param mtx		Mutex.
+ * @param type		Type of the mutex.
  */
-void mutex_initialize(mutex_t *mtx)
+void mutex_initialize(mutex_t *mtx, mutex_type_t type)
 {
+	mtx->type = type;
 	semaphore_initialize(&mtx->sem, 1);
 }
 
-/** Acquire mutex
+/** Acquire mutex.
  *
- * Acquire mutex.
  * Timeout mode and non-blocking mode can be requested.
  *
- * @param mtx Mutex.
- * @param usec Timeout in microseconds.
- * @param flags Specify mode of operation.
+ * @param mtx		Mutex.
+ * @param usec		Timeout in microseconds.
+ * @param flags		Specify mode of operation.
  *
  * For exact description of possible combinations of
  * usec and flags, see comment for waitq_sleep_timeout().
  *
- * @return See comment for waitq_sleep_timeout().
+ * @return		See comment for waitq_sleep_timeout().
  */
 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags)
 {
-	return _semaphore_down_timeout(&mtx->sem, usec, flags);
+	int rc;
+
+	if (mtx->type == MUTEX_PASSIVE) {
+		rc = _semaphore_down_timeout(&mtx->sem, usec, flags);
+	} else {
+		ASSERT(mtx->type == MUTEX_ACTIVE);
+		ASSERT(usec == SYNCH_NO_TIMEOUT);
+		ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE));
+		do {
+			rc = semaphore_trydown(&mtx->sem);
+		} while (SYNCH_FAILED(rc) &&
+		    !(flags & SYNCH_FLAGS_NON_BLOCKING));
+	}
+
+	return rc;
 }
 
-/** Release mutex
+/** Release mutex.
  *
- * Release mutex.
- *
- * @param mtx Mutex.
+ * @param mtx		Mutex.
  */
 void mutex_unlock(mutex_t *mtx)
Index: kernel/generic/src/synch/rwlock.c
===================================================================
--- kernel/generic/src/synch/rwlock.c	(revision 8ed4014bd99932e9f124b453fe8252eeda6db443)
+++ kernel/generic/src/synch/rwlock.c	(revision 1bb37660771ac9b30c844daebd5d607ac7468abe)
@@ -83,5 +83,5 @@
 void rwlock_initialize(rwlock_t *rwl) {
 	spinlock_initialize(&rwl->lock, "rwlock_t");
-	mutex_initialize(&rwl->exclusive);
+	mutex_initialize(&rwl->exclusive, MUTEX_PASSIVE);
 	rwl->readers_in = 0;
 }
