diff --git a/base-foc/src/base/thread/thread_bootstrap.cc b/base-foc/src/base/thread/thread_bootstrap.cc
index f2997eb907..c7574ae428 100644
--- a/base-foc/src/base/thread/thread_bootstrap.cc
+++ b/base-foc/src/base/thread/thread_bootstrap.cc
@@ -11,7 +11,6 @@
* under the terms of the GNU General Public License version 2.
*/
-#include
#include
@@ -25,7 +24,8 @@ void Genode::Thread_base::_thread_start()
Thread_base::myself()->_thread_bootstrap();
Thread_base::myself()->entry();
Thread_base::myself()->_join_lock.unlock();
- sleep_forever();
+ Lock sleep_forever_lock(Lock::LOCKED);
+ sleep_forever_lock.lock();
}