LCOV - code coverage report
Current view: top level - src/util - thread.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 7 10 70.0 %
Date: 2026-06-25 07:23:43 Functions: 1 1 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2021 The Bitcoin Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #include <util/thread.h>
       6             : 
       7             : #include <logging.h>
       8             : #include <util/system.h>
       9             : #include <util/threadnames.h>
      10             : 
      11             : #include <exception>
      12             : #include <functional>
      13             : 
      14       39599 : void util::TraceThread(const char* thread_name, std::function<void()> thread_func)
      15             : {
      16       39599 :     util::ThreadRename(thread_name);
      17             :     try {
      18       39599 :         LogPrintf("%s thread start\n", thread_name);
      19       39547 :         thread_func();
      20       39521 :         LogPrintf("%s thread exit\n", thread_name);
      21       39547 :     } catch (...) {
      22           0 :         PrintExceptionContinue(std::current_exception(), thread_name);
      23           0 :         throw;
      24           0 :     }
      25       39651 : }

Generated by: LCOV version 1.16