Index: kernel/genarch/src/mm/as_ht.c
===================================================================
--- kernel/genarch/src/mm/as_ht.c	(revision deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/genarch/src/mm/as_ht.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -73,5 +73,5 @@
 	if (flags & FLAG_AS_KERNEL) {
 		hash_table_create(&page_ht, PAGE_HT_ENTRIES, 2, &ht_operations);
-		mutex_initialize(&page_ht_lock);
+		mutex_initialize(&page_ht_lock, MUTEX_PASSIVE);
 	}
 	return NULL;
Index: kernel/generic/include/synch/mutex.h
===================================================================
--- kernel/generic/include/synch/mutex.h	(revision deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/generic/include/synch/mutex.h	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -40,18 +40,24 @@
 #include <synch/synch.h>
 
+typedef enum {
+	MUTEX_PASSIVE,
+	MUTEX_ACTIVE
+} mutex_type_t;
+
 typedef struct {
+	mutex_type_t type;
 	semaphore_t sem;
 } mutex_t;
 
-#define mutex_lock(mtx) \
+#define mutex_lock(mtx)			\
 	_mutex_lock_timeout((mtx), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
-#define mutex_trylock(mtx) \
+#define mutex_trylock(mtx)		\
 	_mutex_lock_timeout((mtx), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NON_BLOCKING)
-#define mutex_lock_timeout(mtx, usec) \
+#define mutex_lock_timeout(mtx, usec)	\
 	_mutex_lock_timeout((mtx), (usec), SYNCH_FLAGS_NON_BLOCKING)
 
-extern void mutex_initialize(mutex_t *mtx);
-extern int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags);
-extern void mutex_unlock(mutex_t *mtx);
+extern void mutex_initialize(mutex_t *, mutex_type_t);
+extern int _mutex_lock_timeout(mutex_t *, uint32_t, int);
+extern void mutex_unlock(mutex_t *);
 
 #endif
Index: kernel/generic/src/ipc/ipc.c
===================================================================
--- kernel/generic/src/ipc/ipc.c	(revision deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/generic/src/ipc/ipc.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -162,5 +162,5 @@
 void ipc_phone_init(phone_t *phone)
 {
-	mutex_initialize(&phone->lock);
+	mutex_initialize(&phone->lock, MUTEX_PASSIVE);
 	phone->callee = NULL;
 	phone->state = IPC_PHONE_FREE;
Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/generic/src/mm/as.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -127,5 +127,5 @@
 
 	link_initialize(&as->inactive_as_with_asid_link);
-	mutex_initialize(&as->lock);	
+	mutex_initialize(&as->lock, MUTEX_PASSIVE);	
 	
 	rc = as_constructor_arch(as, flags);
@@ -169,5 +169,5 @@
 	as = [as_t new];
 	link_initialize(&as->inactive_as_with_asid_link);
-	mutex_initialize(&as->lock);	
+	mutex_initialize(&as->lock, MUTEX_PASSIVE);	
 	(void) as_constructor_arch(as, flags);
 #else
@@ -313,5 +313,5 @@
 	a = (as_area_t *) malloc(sizeof(as_area_t), 0);
 
-	mutex_initialize(&a->lock);
+	mutex_initialize(&a->lock, MUTEX_PASSIVE);
 	
 	a->as = as;
@@ -695,5 +695,5 @@
 	if (!sh_info) {
 		sh_info = (share_info_t *) malloc(sizeof(share_info_t), 0);
-		mutex_initialize(&sh_info->lock);
+		mutex_initialize(&sh_info->lock, MUTEX_PASSIVE);
 		sh_info->refcount = 2;
 		btree_create(&sh_info->pagemap);
Index: kernel/generic/src/proc/task.c
===================================================================
--- kernel/generic/src/proc/task.c	(revision deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/generic/src/proc/task.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -181,5 +181,5 @@
 	atomic_set(&ta->active_calls, 0);
 
-	mutex_initialize(&ta->futexes_lock);
+	mutex_initialize(&ta->futexes_lock, MUTEX_PASSIVE);
 	btree_create(&ta->futexes);
 	
Index: kernel/generic/src/synch/condvar.c
===================================================================
--- kernel/generic/src/synch/condvar.c	(revision deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/generic/src/synch/condvar.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -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 deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/generic/src/synch/mutex.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -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 deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/generic/src/synch/rwlock.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -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;
 }
Index: kernel/test/mm/slab2.c
===================================================================
--- kernel/test/mm/slab2.c	(revision deaf8d550ca13cfcdab1e6faa67f3aaba90355a9)
+++ kernel/test/mm/slab2.c	(revision 08a19ba655441635df46ca12a53414694005e074)
@@ -217,5 +217,5 @@
 	
 	condvar_initialize(&thread_starter);
-	mutex_initialize(&starter_mutex);
+	mutex_initialize(&starter_mutex, MUTEX_PASSIVE);
 
 	thr_cache = slab_cache_create("thread_cache", size, 0, NULL, NULL, 0);
