LCOV - code coverage report
Current view: top level - src/util - thread.cpp (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 0 13 0.0 %
Date: 2024-01-03 14:57:27 Functions: 0 1 0.0 %
Branches: 0 28 0.0 %

           Branch data     Line data    Source code
       1                 :            : // Copyright (c) 2021-2022 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/exception.h>
       9                 :            : #include <util/threadnames.h>
      10                 :            : 
      11                 :            : #include <exception>
      12                 :            : #include <functional>
      13                 :            : #include <string>
      14                 :            : #include <utility>
      15                 :            : 
      16                 :          0 : void util::TraceThread(std::string_view thread_name, std::function<void()> thread_func)
      17                 :            : {
      18 [ #  # ][ #  # ]:          0 :     util::ThreadRename(std::string{thread_name});
      19                 :            :     try {
      20 [ #  # ][ #  # ]:          0 :         LogPrintf("%s thread start\n", thread_name);
                 [ #  # ]
      21         [ #  # ]:          0 :         thread_func();
      22 [ #  # ][ #  # ]:          0 :         LogPrintf("%s thread exit\n", thread_name);
                 [ #  # ]
      23         [ #  # ]:          0 :     } catch (const std::exception& e) {
      24         [ #  # ]:          0 :         PrintExceptionContinue(&e, thread_name);
      25                 :          0 :         throw;
      26         [ #  # ]:          0 :     } catch (...) {
      27         [ #  # ]:          0 :         PrintExceptionContinue(nullptr, thread_name);
      28                 :          0 :         throw;
      29         [ #  # ]:          0 :     }
      30                 :          0 : }

Generated by: LCOV version 1.14