This commit is contained in:
Alex
2018-08-20 14:50:45 +02:00
committed by GitHub
parent b7e3d10fb7
commit 49232eed8d
30 changed files with 261 additions and 235 deletions

View File

@ -70,26 +70,13 @@ struct SleeperThread {
condvar_.notify_all();
}
void emit()
{
Glib::signal_idle().connect_once([this] {
sig_update.emit();
});
}
~SleeperThread()
{
do_run_ = false;
condvar_.notify_all();
auto native_handle = thread_.native_handle();
pthread_cancel(native_handle);
if (thread_.joinable()) {
thread_.join();
}
thread_.detach();
}
sigc::signal<void> sig_update;
private:
std::thread thread_;
std::condition_variable condvar_;