mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Better
This commit is contained in:
parent
ae7a5a6554
commit
0fe4d0732d
@ -37,11 +37,7 @@ public:
|
||||
if (res == UV_EBUSY)
|
||||
{
|
||||
LOG_DEBUG(log, "Closing pending handles");
|
||||
uv_walk(loop_ptr.get(), [](uv_handle_t * handle, void *)
|
||||
{
|
||||
if (!uv_is_closing(handle))
|
||||
uv_close(handle, [](uv_handle_t *){});
|
||||
}, nullptr);
|
||||
uv_walk(loop_ptr.get(), onUVWalkClosingCallback, nullptr);
|
||||
|
||||
/// Run the loop until there are no pending callbacks.
|
||||
while (true)
|
||||
@ -72,6 +68,14 @@ public:
|
||||
private:
|
||||
std::unique_ptr<uv_loop_t> loop_ptr;
|
||||
Poco::Logger * log = &Poco::Logger::get("UVLoop");
|
||||
|
||||
static void onUVWalkClosingCallback(uv_handle_t * handle, void *)
|
||||
{
|
||||
if (!uv_is_closing(handle))
|
||||
uv_close(handle, onUVCloseCallback);
|
||||
}
|
||||
|
||||
static void onUVCloseCallback(uv_handle_t *) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user