Files

22 lines
582 B
C++

#include <Void/Async/Executor.hpp>
#include <Void/IO/Driver.hpp>
#include <Void/System/AsyncProcess.hpp>
#include <Void/System/AsyncWatcher.hpp>
int main()
{
Void::Async::ManualExecutor exec;
auto drv = Void::IO::Driver::create(exec);
if (!drv.has_value()) {
return 1;
}
Void::SystemAsync::ProcessManager mgr{**drv, exec};
Void::SystemAsync::WatcherService watcher{exec};
if (mgr.active_children() != 0 || watcher.watch_count() != 0) {
return 2;
}
(void)watcher.shutdown();
(void)(*drv)->shutdown_and_join();
return 0;
}