mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-26 17:01:07 +00:00
5c8373bec3
This patch introduces clean synchronization between the entrypoint thread and the caller of the 'Rpc_entrypoint' destructor. The most important change is the handling of the 'Ipc_server' destruction. This object is in the local scope of the server's entry function. However, since the server loop used to be an infinite loop, there was hardly any chance to destruct the object in a clean way. Hence, the 'Rpc_entrypoint' destructor used to explicitly call '~Ipc_server'. Unfortunately, this approach led to problems because there are indeed rare cases where the server thread leaves the scope of the entry function, namely uncaught exceptions. In such a case, the destructor would have been called twice. With the new protocol, we make sure to leave the scope of the entry function and thereby destroy the 'Ipc_server' object as expected. This is achieved by propagating the exit condition through a local RPC call to the entrypoint. This way, the blocking state of the entrypoint becomes unblocked. Furthermore, '~Rpc_entrypoint' makes use of the new 'join' function to wait for the completion of the server thread. |
||
---|---|---|
.. | ||
allocator_avl.h | ||
allocator_guard.h | ||
allocator.h | ||
blocking.h | ||
cancelable_lock.h | ||
capability.h | ||
child.h | ||
connection.h | ||
console.h | ||
crt0.h | ||
elf.h | ||
env.h | ||
errno.h | ||
exception.h | ||
heap.h | ||
ipc_generic.h | ||
ipc.h | ||
lock_guard.h | ||
lock.h | ||
native_capability.h | ||
object_pool.h | ||
pager.h | ||
platform_env.h | ||
printf.h | ||
process.h | ||
rpc_args.h | ||
rpc_client.h | ||
rpc_server.h | ||
rpc.h | ||
semaphore.h | ||
service.h | ||
signal.h | ||
slab.h | ||
sleep.h | ||
snprintf.h | ||
stdint.h | ||
sync_allocator.h | ||
thread_state.h | ||
thread.h | ||
tslab.h |