core: use Mutex/Blockade

Issue #3612
This commit is contained in:
Alexander Boettcher
2020-02-18 15:29:47 +01:00
committed by Christian Helmuth
parent 85a1f91f59
commit e87d60ddf7
48 changed files with 218 additions and 232 deletions

View File

@ -27,8 +27,8 @@ class Genode::Irq_object : public Thread_deprecated<4096>
private:
Genode::Signal_context_capability _sig_cap;
Genode::Lock _sync_ack;
Genode::Lock _sync_bootup;
Genode::Blockade _sync_ack { };
Genode::Blockade _sync_bootup { };
unsigned const _irq;
int _fd;

View File

@ -45,8 +45,6 @@ Genode::Irq_session::Info Genode::Irq_session_component::info()
Genode::Irq_object::Irq_object(unsigned irq) :
Thread_deprecated<4096>("irq"),
_sig_cap(Signal_context_capability()),
_sync_ack(Lock::LOCKED),
_sync_bootup(Lock::LOCKED),
_irq(irq),
_fd(-1)
{

View File

@ -53,8 +53,6 @@ Genode::Irq_session::Info Genode::Irq_session_component::info()
Genode::Irq_object::Irq_object(unsigned irq) :
Thread_deprecated<4096>("irq"),
_sig_cap(Signal_context_capability()),
_sync_ack(Lock::LOCKED),
_sync_bootup(Lock::LOCKED),
_irq(irq),
_fd(-1)
{ }
@ -82,8 +80,8 @@ void Genode::Irq_object::entry()
error("failed to register IRQ ", _irq);
}
_sync_bootup.unlock();
_sync_ack.lock();
_sync_bootup.wakeup();
_sync_ack.block();
while (true) {
@ -97,19 +95,19 @@ void Genode::Irq_object::entry()
Genode::Signal_transmitter(_sig_cap).submit(1);
_sync_ack.lock();
_sync_ack.block();
}
}
void Genode::Irq_object::ack_irq()
{
_sync_ack.unlock();
_sync_ack.wakeup();
}
void Genode::Irq_object::start()
{
Genode::Thread::start();
_sync_bootup.lock();
_sync_bootup.block();
}
void Genode::Irq_object::sigh(Signal_context_capability cap)