mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
wpiutil: uv: Add LoopClosing status to Handle (#1647)
Useful for EventLoopRunner to know if a stop is requested, or close is happening for another reason.
This commit is contained in:
committed by
Peter Johnson
parent
7cd6e2e7fa
commit
620bec9cae
@@ -49,7 +49,10 @@ EventLoopRunner::~EventLoopRunner() { Stop(); }
|
||||
void EventLoopRunner::Stop() {
|
||||
ExecAsync([](uv::Loop& loop) {
|
||||
// close all handles; this will (eventually) stop the loop
|
||||
loop.Walk([](uv::Handle& h) { h.Close(); });
|
||||
loop.Walk([](uv::Handle& h) {
|
||||
h.SetLoopClosing(true);
|
||||
h.Close();
|
||||
});
|
||||
});
|
||||
m_owner.Join();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user