mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
Synchronize startup of signal receiver thread
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user