mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
base: synchronize signal-proxy thread destruction
This commit is contained in:
parent
1c1cbb9b95
commit
c4c19f885f
@ -122,6 +122,10 @@ class Genode::Entrypoint : Noncopyable
|
||||
bool _wait_and_dispatch_one_io_signal(bool dont_block);
|
||||
|
||||
Constructible<Signal_proxy_thread> _signal_proxy_thread { };
|
||||
bool _stop_signal_proxy { false };
|
||||
|
||||
void _handle_stop_signal_proxy() { _stop_signal_proxy = true; }
|
||||
Constructible<Genode::Signal_handler<Entrypoint>> _stop_signal_proxy_handler { };
|
||||
|
||||
friend class Startup;
|
||||
|
||||
@ -141,10 +145,7 @@ class Genode::Entrypoint : Noncopyable
|
||||
Entrypoint(Env &env, size_t stack_size, char const *name,
|
||||
Affinity::Location);
|
||||
|
||||
~Entrypoint()
|
||||
{
|
||||
_rpc_ep->dissolve(&_signal_proxy);
|
||||
}
|
||||
~Entrypoint();
|
||||
|
||||
/**
|
||||
* Associate RPC object with the entry point
|
||||
|
@ -66,6 +66,8 @@ _ZN6Genode10EntrypointC1ERNS_3EnvE T
|
||||
_ZN6Genode10EntrypointC1ERNS_3EnvEmPKc T
|
||||
_ZN6Genode10EntrypointC1ERNS_3EnvEmPKcNS_8Affinity8LocationE T
|
||||
_ZN6Genode10EntrypointC2ERNS_3EnvEmPKcNS_8Affinity8LocationE T
|
||||
_ZN6Genode10EntrypointD1Ev T
|
||||
_ZN6Genode10EntrypointD2Ev T
|
||||
_ZN6Genode10Ipc_serverC1Ev T
|
||||
_ZN6Genode10Ipc_serverC2Ev T
|
||||
_ZN6Genode10Ipc_serverD1Ev T
|
||||
|
@ -135,6 +135,11 @@ void Entrypoint::_process_incoming_signals()
|
||||
*/
|
||||
_signal_pending_ack_lock.lock();
|
||||
}
|
||||
|
||||
/* entrypoint destructor requested to stop signal handling */
|
||||
if (_stop_signal_proxy) {
|
||||
return;
|
||||
}
|
||||
} while (!_suspended);
|
||||
|
||||
_deferred_signal_handler.destruct();
|
||||
@ -333,6 +338,7 @@ Entrypoint::Entrypoint(Env &env)
|
||||
_process_incoming_signals();
|
||||
}
|
||||
|
||||
|
||||
Entrypoint::Entrypoint(Env &env, size_t stack_size, char const *name,
|
||||
Affinity::Location location)
|
||||
:
|
||||
@ -344,3 +350,14 @@ Entrypoint::Entrypoint(Env &env, size_t stack_size, char const *name,
|
||||
Thread::Weight(), env.cpu());
|
||||
}
|
||||
|
||||
Entrypoint::~Entrypoint()
|
||||
{
|
||||
/* stop the signal proxy before destruction */
|
||||
_stop_signal_proxy_handler.construct(
|
||||
*this, *this, &Entrypoint::_handle_stop_signal_proxy);
|
||||
Signal_transmitter(*_stop_signal_proxy_handler).submit();
|
||||
_signal_proxy_thread->join();
|
||||
_stop_signal_proxy_handler.destruct();
|
||||
|
||||
_rpc_ep->dissolve(&_signal_proxy);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user