genode/base-foc/src/base/thread/thread_bootstrap.cc
Christian Prochaska 46a81ab890 foc: don't call 'sleep_forever()' on thread exit
The generic 'sleep_forever()' function creates an Ipc_server object which
might not get cleaned up correctly when the thread gets destroyed and
unneeded capability references could remain and drain the capability index
allocator. With this patch a lock gets used on thread exit instead of
calling 'sleep_forever()'.

Fixes #538.
2012-11-29 09:55:09 +01:00

33 lines
697 B
C++

/*
* \brief Fiasco.OC specific thread bootstrap code
* \author Stefan Kalkowski
* \date 2011-01-20
*/
/*
* Copyright (C) 2011-2012 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#include <base/thread.h>
void Genode::Thread_base::_thread_bootstrap() { }
void Genode::Thread_base::_thread_start()
{
using namespace Genode;
Thread_base::myself()->_thread_bootstrap();
Thread_base::myself()->entry();
Thread_base::myself()->_join_lock.unlock();
Lock sleep_forever_lock(Lock::LOCKED);
sleep_forever_lock.lock();
}
void Genode::Thread_base::_init_platform_thread() { }