mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-29 18:18:54 +00:00
Synchronize startup of signal receiver thread
This commit is contained in:
parent
4454eb03eb
commit
b37a28578c
@ -129,6 +129,7 @@ namespace {
|
||||
|
||||
unsigned _count;
|
||||
Block_device **_devs;
|
||||
Genode::Lock _ready_lock;
|
||||
|
||||
protected:
|
||||
|
||||
@ -144,6 +145,8 @@ namespace {
|
||||
_devs[i]->session()->tx_channel()->sigh_ack_avail(cap);
|
||||
}
|
||||
|
||||
_ready_lock.unlock();
|
||||
|
||||
while (true) {
|
||||
Signal s = receiver.wait_for_signal();
|
||||
for (unsigned i = 0; i < _count; i++) {
|
||||
@ -160,7 +163,19 @@ namespace {
|
||||
|
||||
Signal_thread(Block_device **devs)
|
||||
: Genode::Thread<8192>("blk-signal-thread"),
|
||||
_count(Fiasco::genode_block_count()), _devs(devs) {}
|
||||
_count(Fiasco::genode_block_count()), _devs(devs),
|
||||
_ready_lock(Genode::Lock::LOCKED) {}
|
||||
|
||||
void start()
|
||||
{
|
||||
Genode::Thread_base::start();
|
||||
|
||||
/*
|
||||
* Do not return until the new thread has initialized the
|
||||
* signal handlers.
|
||||
*/
|
||||
_ready_lock.lock();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user