DDE_KIT: Startup synchronization for IRQ thread

Wait until 'entry' function of IRQ threads is called.
This commit is contained in:
Sebastian Sumpf 2012-10-24 14:44:25 +02:00 committed by Norman Feske
parent 727f29f2e9
commit 8ac3209aa8
1 changed files with 10 additions and 2 deletions

View File

@ -68,8 +68,13 @@ class Irq_handler : Dde_kit::Thread, public Avl_node<Irq_handler>
:
Dde_kit::Thread(_compose_thread_name(irq)), _irq_number(irq),
_irq(irq), _handler(handler), _init(init), _priv(priv),
_shared(shared), _handle_irq(1)
{ start(); }
_shared(shared), _handle_irq(1), _lock(Lock::LOCKED)
{
start();
/* wait until thread is started */
Lock::Guard guard(_lock);
}
/** Enable IRQ handling */
void enable()
@ -93,6 +98,9 @@ class Irq_handler : Dde_kit::Thread, public Avl_node<Irq_handler>
/* call user init function before doing anything else here */
if (_init) _init(_priv);
/* unblock creating thread */
_lock.unlock();
while (1) {
_irq.wait_for_irq();