In the thread manager's thread map a hook was not removed when the
last thread was removed for that hook. This caused the main loop to
not pause when the last timed thread was gone, rendering the
power saving defeated after a load/unload cycle, for which this was
implemented.
BlockedTimingAspect::WakeupHook hook = timed_thread->blockedTimingAspectHook();
if ( threads.find(hook) != threads.end() ) {
threads[hook].remove_locked(t);
+ if (threads[hook].empty()) threads.erase(hook);
}
} else {
untimed_threads.remove_locked(t);