This repository has been archived on 2023-08-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2016-10-15 09:12:01 -04:00
|
|
|
#include "event.hpp"
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
|
|
namespace nntpchan
|
|
|
|
|
{
|
|
|
|
|
Mainloop::Mainloop()
|
|
|
|
|
{
|
|
|
|
|
m_loop = uv_default_loop();
|
|
|
|
|
assert(uv_loop_init(m_loop) == 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Mainloop::~Mainloop()
|
|
|
|
|
{
|
|
|
|
|
uv_loop_close(m_loop);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Mainloop::Stop()
|
|
|
|
|
{
|
|
|
|
|
uv_stop(m_loop);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Mainloop::Run(uv_run_mode mode)
|
|
|
|
|
{
|
2017-05-03 09:44:42 -04:00
|
|
|
assert(uv_run(m_loop, mode) == 0);
|
2016-10-15 09:12:01 -04:00
|
|
|
}
|
2017-05-03 09:44:42 -04:00
|
|
|
|
2016-10-15 09:12:01 -04:00
|
|
|
}
|