Fixed tabs vs spaces indentations (#157)
This commit is contained in:
committed by
Jason Watkins
parent
50335c4a5c
commit
90ccec0d07
@@ -5,23 +5,23 @@
|
||||
using namespace std;
|
||||
|
||||
namespace XPC {
|
||||
void Timer::start(const chrono::milliseconds interval, const Callback &callback) {
|
||||
{
|
||||
running.test_and_set();
|
||||
th = thread([=]()
|
||||
{
|
||||
while (running.test_and_set()) {
|
||||
this_thread::sleep_for(interval);
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void Timer::stop() {
|
||||
running.clear();
|
||||
if(th.joinable()) {
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
void Timer::start(const chrono::milliseconds interval, const Callback &callback) {
|
||||
{
|
||||
running.test_and_set();
|
||||
th = thread([=]()
|
||||
{
|
||||
while (running.test_and_set()) {
|
||||
this_thread::sleep_for(interval);
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void Timer::stop() {
|
||||
running.clear();
|
||||
if(th.joinable()) {
|
||||
th.join();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user