mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-30 06:04:25 +00:00
pc_wifi_drv: unblock pthread via signal
Since unblocking the pthread directly may lead to corruption we need to post-pone it. So we send a signal that should be handled by the EP after the EP has finished its current line of work. Fixes #4523.
This commit is contained in:
parent
9d383037e4
commit
d3e53b3cca
@ -237,6 +237,8 @@ class Lx::Socket
|
|||||||
Genode::Signal_transmitter _sender { };
|
Genode::Signal_transmitter _sender { };
|
||||||
Genode::Signal_handler<Lx::Socket> _dispatcher;
|
Genode::Signal_handler<Lx::Socket> _dispatcher;
|
||||||
|
|
||||||
|
Genode::Signal_handler<Lx::Socket> _dispatcher_blockade;
|
||||||
|
|
||||||
struct socket *_sock_poll_table[Wifi::MAX_POLL_SOCKETS] { };
|
struct socket *_sock_poll_table[Wifi::MAX_POLL_SOCKETS] { };
|
||||||
|
|
||||||
struct socket *_call_socket()
|
struct socket *_call_socket()
|
||||||
@ -411,11 +413,17 @@ class Lx::Socket
|
|||||||
Lx_kit::env().scheduler.schedule();
|
Lx_kit::env().scheduler.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _handle_blockade()
|
||||||
|
{
|
||||||
|
_block.up();
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Socket(Genode::Entrypoint &ep)
|
Socket(Genode::Entrypoint &ep)
|
||||||
:
|
:
|
||||||
_dispatcher(ep, *this, &Lx::Socket::_handle)
|
_dispatcher(ep, *this, &Lx::Socket::_handle),
|
||||||
|
_dispatcher_blockade(ep, *this, &Lx::Socket::_handle_blockade)
|
||||||
{
|
{
|
||||||
_sender.context(_dispatcher);
|
_sender.context(_dispatcher);
|
||||||
}
|
}
|
||||||
@ -448,7 +456,7 @@ class Lx::Socket
|
|||||||
|
|
||||||
_call.opcode = Call::NONE;
|
_call.opcode = Call::NONE;
|
||||||
|
|
||||||
if (old != Call::NONE) { _block.up(); }
|
if (old != Call::NONE) { _dispatcher_blockade.local_submit(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void submit_and_block()
|
void submit_and_block()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user