mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
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.
This commit is contained in:
parent
b3815c95a7
commit
46a81ab890
@ -11,7 +11,6 @@
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/sleep.h>
|
||||
#include <base/thread.h>
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user