• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/libs/core/threading_base/src/get_default_timer_service.cpp
1
//  Copyright (c) 2007-2025 Hartmut Kaiser
2
//  Copyright (c)      2011 Bryce Lelbach
3
//  Copyright (c)      2020 Nikunj Gupta
4
//
5
//  SPDX-License-Identifier: BSL-1.0
6
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
7
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8

9
#include <hpx/assert.hpp>
10
#include <hpx/modules/errors.hpp>
11
#include <hpx/threading_base/detail/get_default_timer_service.hpp>
12

13
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
14
#include <winsock2.h>
15
#endif
16
#include <asio/io_context.hpp>
17

18
namespace hpx::threads::detail {
19

20
    static get_default_timer_service_type get_default_timer_service_f;
21

22
    void set_get_default_timer_service(get_default_timer_service_type f)
23
    {
64✔
24
        get_default_timer_service_f = HPX_MOVE(f);
25
    }
26

64✔
27
    ::asio::io_context& get_default_timer_service()
28
    {
141✔
29
        if (detail::get_default_timer_service_f)
30
        {
141✔
31
            return detail::get_default_timer_service_f();
32
        }
141✔
33
        else
34
        {
35
#if defined(HPX_HAVE_TIMER_POOL)
36
            HPX_THROW_EXCEPTION(hpx::error::invalid_status,
37
                "hpx::threads::detail::get_default_timer_service",
×
38
                "No timer service installed. When running timed "
39
                "threads without a runtime a timer service has to be "
40
                "installed manually using "
41
                "hpx::threads::detail::set_get_default_timer_service.");
42
#else
43
            HPX_THROW_EXCEPTION(hpx::error::invalid_status,
44
                "hpx::threads::detail::get_default_timer_service",
45
                "No timer service installed. Rebuild HPX with "
46
                "HPX_WITH_TIMER_POOL=ON or provide a timer service "
47
                "manually using "
48
                "hpx::threads::detail::set_get_default_timer_service.");
49
#endif
50
        }
51
    }
52
}    // namespace hpx::threads::detail
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc