mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
28 lines
478 B
C++
28 lines
478 B
C++
#include "core/loops/event_loop_thread.h"
|
|
#include <iostream>
|
|
#include <atomic>
|
|
#include <future>
|
|
#ifndef _WIN32
|
|
#include <unistd.h>
|
|
#endif
|
|
|
|
int main()
|
|
{
|
|
std::atomic<bool> flag(false);
|
|
{
|
|
trantor::EventLoopThread thr;
|
|
thr.getLoop()->runOnQuit([&]() { flag = true; });
|
|
thr.run();
|
|
thr.getLoop()->quit();
|
|
}
|
|
|
|
if (flag == false)
|
|
{
|
|
std::cerr << "Test failed\n";
|
|
}
|
|
else
|
|
{
|
|
std::cout << "Success\n";
|
|
}
|
|
}
|