From 346c16b4e2ea26f47e0e370a490b7794492a9ebb Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 23 Mar 2025 19:48:53 +0530 Subject: Apply clang-tidy suggestions --- src/AsyncEventLoop.hpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'src/AsyncEventLoop.hpp') diff --git a/src/AsyncEventLoop.hpp b/src/AsyncEventLoop.hpp index 8082dfa..7a3ed69 100644 --- a/src/AsyncEventLoop.hpp +++ b/src/AsyncEventLoop.hpp @@ -16,30 +16,28 @@ public: ~AsyncEventLoop(); void wake(); - DEFINE_GETTER(getUVLoop, loop) + DEFINE_GETTER(get_uv_loop, loop) - template void queueTask(F &&task) { + template void queue_task(F &&task) { { - std::lock_guard lock(tasksQueueMutex); - tasksQueue.push(std::forward(task)); + const std::lock_guard lock(tasks_queue_mutex); + tasks_queue.push(std::forward(task)); } wake(); } protected: - void runLoop(); - void processTasks(); - static void asyncHandleCallback(uv_async_t *handle); - static void closeHandle(uv_handle_t *handle, void *arg = nullptr); - -private: - void flushTasks(); + void run_loop(); + void process_tasks(); + void flush_tasks(); + static void async_handle_callback(uv_async_t *handle); + static void close_handle(uv_handle_t *handle, void *arg = nullptr); private: uv_loop_t *loop; - std::thread loopThread; - uv_async_t asyncHandle; - std::atomic isLoopRunning = false; - std::queue> tasksQueue; - std::mutex tasksQueueMutex; + std::thread loop_thread; + uv_async_t async_handle; + std::atomic is_loop_running = false; + std::queue> tasks_queue; + std::mutex tasks_queue_mutex; }; -- cgit v1.3.1