• 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

0.0
/libs/full/runtime_components/src/console_error_sink.cpp
1
//  Copyright (c) 2007-2021 Hartmut Kaiser
2
//  Copyright (c) 2011      Bryce Lelbach
3
//
4
//  SPDX-License-Identifier: BSL-1.0
5
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
6
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7

8
#include <hpx/config.hpp>
9
#include <hpx/agas/addressing_service.hpp>
10
#include <hpx/async_distributed/continuation.hpp>
11
#include <hpx/modules/async_distributed.hpp>
12
#include <hpx/modules/errors.hpp>
13
#include <hpx/modules/runtime_local.hpp>
14
#include <hpx/runtime_components/console_error_sink.hpp>
15
#include <hpx/runtime_components/server/console_error_sink.hpp>
16

17
#include <exception>
18

19
///////////////////////////////////////////////////////////////////////////////
20
namespace hpx { namespace components {
21

22
    // Stub function which applies the console_error_sink action.
23
    void console_error_sink(
×
24
        hpx::id_type const& dst, std::exception_ptr const& e)
25
    {
26
        // Report the error only if the thread-manager is up.
27
        if (threads::threadmanager_is(hpx::state::running))
×
28
        {
29
            if (threads::get_self_ptr())
×
30
            {
31
                hpx::async<server::console_error_sink_action>(dst, e).get();
×
32
            }
33
            else
34
            {
35
                // FIXME: This should use a sync_put_parcel.
36
                hpx::post<server::console_error_sink_action>(dst, e);
37
            }
38
        }
39
    }
×
40

41
    /// Stub function which applies the console_error_sink action.
42
    ///
43
    /// \note Must be called from a HPX-thread.
44
    void console_error_sink(std::exception_ptr const& e)
×
45
    {
46
        if (HPX_UNLIKELY(!threads::get_self_ptr()))
×
47
        {
48
            HPX_THROW_EXCEPTION(hpx::error::null_thread_id,
×
49
                "components::console_error_sink",
50
                "console_error_sink was not called from a HPX-thread");
51
        }
52

53
        // Report the error only if the thread-manager is up.
54
        if (threads::threadmanager_is(hpx::state::running))
×
55
        {
56
            // retrieve console locality
57
            naming::gid_type console_gid;
×
58
            naming::get_agas_client().get_console_locality(console_gid);
×
59
            hpx::id_type dst(
60
                console_gid, hpx::id_type::management_type::unmanaged);
×
61

62
            hpx::async<server::console_error_sink_action>(dst, e).get();
×
63
        }
64
    }
×
65
}}    // namespace hpx::components
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