forked from lix-project/lix
triggerInterrupt: Refactor to use break
This commit is contained in:
parent
c3b942e0fc
commit
ddb6740e7d
1 changed files with 11 additions and 15 deletions
|
@ -1599,20 +1599,18 @@ void triggerInterrupt()
|
|||
|
||||
{
|
||||
InterruptCallbacks::Token i = 0;
|
||||
while (true) {
|
||||
std::function<void()> callback;
|
||||
do {
|
||||
{
|
||||
auto interruptCallbacks(_interruptCallbacks.lock());
|
||||
auto lb = interruptCallbacks->callbacks.lower_bound(i);
|
||||
if (lb != interruptCallbacks->callbacks.end()) {
|
||||
if (lb == interruptCallbacks->callbacks.end())
|
||||
break;
|
||||
|
||||
callback = lb->second;
|
||||
i = lb->first + 1;
|
||||
} else {
|
||||
callback = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
try {
|
||||
callback();
|
||||
} catch (...) {
|
||||
|
@ -1620,8 +1618,6 @@ void triggerInterrupt()
|
|||
}
|
||||
}
|
||||
}
|
||||
while (callback);
|
||||
}
|
||||
}
|
||||
|
||||
static sigset_t savedSignalMask;
|
||||
|
|
Loading…
Reference in a new issue