Index: kernel/generic/src/udebug/udebug.c
===================================================================
--- kernel/generic/src/udebug/udebug.c	(revision 741fd168039c63304d28851d0bfb573bd41fec74)
+++ kernel/generic/src/udebug/udebug.c	(revision ef687799ed9f09e5fdb3f693b156212fd2c49048)
@@ -36,16 +36,4 @@
  *
  * Udebug is an interface that makes userspace debuggers possible.
- *
- * Functions in this file are executed directly in each thread, which
- * may or may not be the subject of debugging. The udebug_stoppable_begin/end()
- * functions are also executed in the clock interrupt handler. To avoid
- * deadlock, functions in this file are protected from the interrupt
- * by locking the recursive lock THREAD->udebug.int_lock (just an atomic
- * variable). This prevents udebug_stoppable_begin/end() from being
- * executed in the interrupt handler (they are skipped).
- *
- * Functions in udebug_ops.c and udebug_ipc.c execute in different threads,
- * so they needn't be protected from the (preemptible) interrupt-initiated
- * code.
  */
  
@@ -56,13 +44,4 @@
 #include <arch.h>
 
-static inline void udebug_int_lock(void)
-{
-	atomic_inc(&THREAD->udebug.int_lock);
-}
-
-static inline void udebug_int_unlock(void)
-{
-	atomic_dec(&THREAD->udebug.int_lock);
-}
 
 /** Initialize udebug part of task structure.
@@ -89,9 +68,4 @@
 	mutex_initialize(&ut->lock, MUTEX_PASSIVE);
 	waitq_initialize(&ut->go_wq);
-
-	/*
-	 * At the beginning the thread is stoppable, so int_lock be set, too.
-	 */
-	atomic_set(&ut->int_lock, 1);
 
 	ut->go_call = NULL;
@@ -162,9 +136,6 @@
 	ASSERT(TASK);
 
-	udebug_int_lock();
-
 	/* Early check for undebugged tasks */
 	if (!udebug_thread_precheck()) {
-		udebug_int_unlock();
 		return;
 	}
@@ -232,5 +203,4 @@
 	/* Early check for undebugged tasks */
 	if (!udebug_thread_precheck()) {
-		udebug_int_unlock();
 		return;
 	}
@@ -258,6 +228,4 @@
 		mutex_unlock(&TASK->udebug.lock);
 	}
-
-	udebug_int_unlock();
 }
 
@@ -274,14 +242,4 @@
 
 	return;
-	ASSERT(!PREEMPTION_DISABLED);
-
-	/* 
-	 * Prevent agains re-entering, such as when preempted inside this
-	 * function.
-	 */
-	if (atomic_get(&THREAD->udebug.int_lock) != 0)
-		return;
-
-	udebug_int_lock();
 
 	ipl = interrupts_enable();
@@ -294,6 +252,4 @@
 
 	interrupts_restore(ipl);
-
-	udebug_int_unlock();
 }
 
@@ -312,9 +268,6 @@
 	etype = end_variant ? UDEBUG_EVENT_SYSCALL_E : UDEBUG_EVENT_SYSCALL_B;
 
-	udebug_int_lock();
-
 	/* Early check for undebugged tasks */
 	if (!udebug_thread_precheck()) {
-		udebug_int_unlock();
 		return;
 	}
@@ -363,6 +316,4 @@
 
 	udebug_wait_for_go(&THREAD->udebug.go_wq);
-
-	udebug_int_unlock();
 }
 
@@ -378,6 +329,4 @@
 {
 	call_t *call;
-
-	udebug_int_lock();
 
 	mutex_lock(&TASK->udebug.lock);
@@ -420,6 +369,4 @@
 	LOG("- sleep\n");
 	udebug_wait_for_go(&THREAD->udebug.go_wq);
-
-	udebug_int_unlock();
 }
 
@@ -432,6 +379,4 @@
 {
 	call_t *call;
-
-	udebug_int_lock();
 
 	mutex_lock(&TASK->udebug.lock);
@@ -468,6 +413,8 @@
 	mutex_unlock(&TASK->udebug.lock);
 
-	/* Leave int_lock enabled. */
-	/* This event does not sleep - debugging has finished in this thread. */
+	/* 
+	 * This event does not sleep - debugging has finished
+	 * in this thread.
+	 */
 }
 
@@ -491,6 +438,4 @@
 	LOG("udebug_task_cleanup()\n");
 	LOG("task %" PRIu64 "\n", ta->taskid);
-
-	udebug_int_lock();
 
 	if (ta->udebug.dt_state != UDEBUG_TS_BEGINNING &&
@@ -555,6 +500,4 @@
 	ta->udebug.debugger = NULL;
 
-	udebug_int_unlock();
-
 	return 0;
 }
