• 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

50.0
/libs/core/execution_base/src/agent_ref.cpp
1
//  Copyright (c) 2019 Thomas Heller
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
#include <hpx/assert.hpp>
8
#include <hpx/execution_base/agent_ref.hpp>
9
#include <hpx/execution_base/this_thread.hpp>
10
#include <hpx/modules/coroutines.hpp>
11
#include <hpx/modules/format.hpp>
12
#include <hpx/modules/lock_registration.hpp>
13

14
#include <cstddef>
15
#include <ostream>
16

17
namespace hpx::execution_base {
18

686,365✔
19
    void agent_ref::yield(char const* desc) const
20
    {
21
        HPX_ASSERT(*this == hpx::execution_base::this_thread::agent());
22

23
        // verify that there are no more registered locks for this OS-thread
24
        util::verify_no_locks();
686,365✔
25
        impl_->yield(desc);
686,365✔
26
    }
27

47,453✔
28
    bool agent_ref::yield_k(std::size_t k, char const* desc) const
29
    {
30
        HPX_ASSERT(*this == hpx::execution_base::this_thread::agent());
31

32
        // verify that there are no more registered locks for this OS-thread
33
        util::verify_no_locks();
47,453✔
34
        return impl_->yield_k(k, desc);
47,453✔
35
    }
36

27,770✔
37
    void agent_ref::suspend(char const* desc) const
38
    {
39
        HPX_ASSERT(*this == hpx::execution_base::this_thread::agent());
40

41
        // verify that there are no more registered locks for this OS-thread
42
        util::verify_no_locks();
27,770✔
43
        impl_->suspend(desc);
27,770✔
44
    }
45

27,770✔
46
    void agent_ref::resume(
47
        hpx::threads::thread_priority priority, char const* desc) const
48
    {
27,770✔
49
        HPX_ASSERT(*this != hpx::execution_base::this_thread::agent());
27,770✔
50
        impl_->resume(priority, desc);
51
    }
×
52

53
    void agent_ref::abort(char const* desc) const
54
    {
×
55
        HPX_ASSERT(*this != hpx::execution_base::this_thread::agent());
×
56
        impl_->abort(desc);
57
    }
×
58

59
    void agent_ref::sleep_for(
60
        hpx::chrono::steady_duration const& sleep_duration,
61
        char const* desc) const
62
    {
×
63
        HPX_ASSERT(*this == hpx::execution_base::this_thread::agent());
×
64
        impl_->sleep_for(sleep_duration, desc);
65
    }
×
66

67
    void agent_ref::sleep_until(
68
        hpx::chrono::steady_time_point const& sleep_time,
69
        char const* desc) const
70
    {
×
71
        HPX_ASSERT(*this == hpx::execution_base::this_thread::agent());
×
72
        impl_->sleep_until(sleep_time, desc);
73
    }
×
74

75
    std::ostream& operator<<(std::ostream& os, agent_ref const& a)
×
76
    {
×
77
        hpx::util::format_to(os, "agent_ref{{{}}}", a.impl_->description());
78
        return os;
79
    }
80
}    // namespace hpx::execution_base
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