LCOV - code coverage report
Current view: top level - src/network - netio_evloop.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 19 0.0 %
Date: 2025-09-09 12:09:29 Functions: 0 5 0.0 %

          Line data    Source code
       1             : #include "network/netio_evloop.hpp"
       2             : #include "netio/netio.h"
       3             : 
       4           0 : NetioEventLoop::NetioEventLoop()
       5           0 :     : ctx(std::make_shared<netio_context>())
       6             : {
       7           0 :     netio_init(ctx.get());
       8           0 : }
       9             : 
      10             : 
      11           0 : void NetioEventLoop::start_thread(const std::string& thread_name)
      12             : {
      13           0 :     m_evloop_thread = std::thread([this, thread_name]{ run(thread_name); });
      14           0 : }
      15             : 
      16             : 
      17           0 : void NetioEventLoop::start()
      18             : {
      19           0 :     netio_run(&(ctx->evloop));
      20           0 : }
      21             : 
      22             : 
      23           0 : void NetioEventLoop::stop()
      24             : {
      25           0 :     netio_terminate_signal(&(ctx->evloop));
      26           0 :     if ( m_evloop_thread.get_id() != std::thread::id() ) {
      27           0 :         m_evloop_thread.join();
      28             :     }
      29           0 : }
      30             : 
      31             : 
      32           0 : void NetioEventLoop::run(const std::string& thread_name)
      33             : {
      34           0 :     pthread_setname_np(pthread_self(), thread_name.c_str());
      35           0 :     netio_run(&(ctx->evloop));
      36           0 : }

Generated by: LCOV version 1.0