Clean (#31)
This commit is contained in:
@ -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_;
|
||||
|
Reference in New Issue
Block a user