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

STEllAR-GROUP / hpx / #856

28 Dec 2022 02:00AM UTC coverage: 86.602% (+0.05%) from 86.55%
#856

push

StellarBot
Merge #6119

6119: Update CMakeLists.txt r=hkaiser a=khuck

updating the default APEX version


Co-authored-by: Kevin Huck <khuck@cs.uoregon.edu>

174566 of 201573 relevant lines covered (86.6%)

1876093.78 hits per line

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

78.13
/libs/core/coroutines/include/hpx/coroutines/detail/coroutine_stackful_self.hpp
1
//  Copyright (c) 2019-2021 Hartmut Kaiser
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
#pragma once
8

9
#include <hpx/config.hpp>
10
#include <hpx/assert.hpp>
11
#include <hpx/coroutines/detail/coroutine_impl.hpp>
12
#include <hpx/coroutines/detail/coroutine_self.hpp>
13
#include <hpx/coroutines/thread_enums.hpp>
14
#include <hpx/coroutines/thread_id_type.hpp>
15

16
#include <cstddef>
17
#include <exception>
18
#include <limits>
19
#include <utility>
20

21
namespace hpx::threads::coroutines::detail {
22

23
    class coroutine_stackful_self : public coroutine_self
6,096,096✔
24
    {
25
    public:
26
        explicit coroutine_stackful_self(
6,096,007✔
27
            impl_type* pimpl, coroutine_self* next_self = nullptr) noexcept
28
          : coroutine_self(next_self)
6,096,009✔
29
          , pimpl_(pimpl)
6,096,009✔
30
        {
12,192,014✔
31
            HPX_ASSERT(pimpl_);
6,096,007✔
32
        }
6,095,989✔
33

34
        arg_type yield_impl(result_type arg) override
76,914,665✔
35
        {
36
            this->pimpl_->bind_result(arg);
76,277,318✔
37

38
            {
39
                reset_self_on_exit on_exit(this);
76,277,318✔
40
                this->pimpl_->yield();
76,277,318✔
41
            }
76,277,318✔
42

43
            return *pimpl_->args();
76,278,496✔
44
        }
×
45

46
        thread_id_type get_thread_id() const noexcept override
109,069,809✔
47
        {
48
            return pimpl_->get_thread_id();
109,072,524✔
49
        }
50

51
#if defined(HPX_HAVE_THREAD_PHASE_INFORMATION)
52
        std::size_t get_thread_phase() const noexcept override
53
        {
54
            return pimpl_->get_thread_phase();
55
        }
56
#else
57
        std::size_t get_thread_phase() const noexcept override
13,766,211✔
58
        {
59
            return 0;
13,766,222✔
60
        }
61
#endif
62

63
#if defined(HPX_HAVE_THREADS_GET_STACK_POINTER)
64
        std::ptrdiff_t get_available_stack_space() const noexcept override
5,454,940✔
65
        {
66
            return pimpl_->get_available_stack_space();
5,454,944✔
67
        }
68
#else
69
        std::ptrdiff_t get_available_stack_space() const noexcept override
70
        {
71
            return (std::numeric_limits<std::ptrdiff_t>::max)();
72
        }
73
#endif
74

75
        std::size_t get_thread_data() const noexcept override
×
76
        {
77
            return pimpl_->get_thread_data();
×
78
        }
79
        std::size_t set_thread_data(std::size_t data) noexcept override
×
80
        {
81
            return pimpl_->set_thread_data(data);
×
82
        }
83

84
#if defined(HPX_HAVE_LIBCDS)
85
        std::size_t get_libcds_data() const override
86
        {
87
            return pimpl_->get_libcds_data();
88
        }
89
        std::size_t set_libcds_data(std::size_t data) override
90
        {
91
            return pimpl_->set_libcds_data(data);
92
        }
93

94
        std::size_t get_libcds_hazard_pointer_data() const override
95
        {
96
            return pimpl_->get_libcds_hazard_pointer_data();
97
        }
98
        std::size_t set_libcds_hazard_pointer_data(std::size_t data) override
99
        {
100
            return pimpl_->set_libcds_hazard_pointer_data(data);
101
        }
102

103
        std::size_t get_libcds_dynamic_hazard_pointer_data() const override
104
        {
105
            return pimpl_->get_libcds_dynamic_hazard_pointer_data();
106
        }
107
        std::size_t set_libcds_dynamic_hazard_pointer_data(
108
            std::size_t data) override
109
        {
110
            return pimpl_->set_libcds_dynamic_hazard_pointer_data(data);
111
        }
112
#endif
113

114
#if defined(HPX_HAVE_THREAD_LOCAL_STORAGE)
115
        tss_storage* get_thread_tss_data() override
5,031✔
116
        {
117
            return pimpl_->get_thread_tss_data(false);
5,031✔
118
        }
119
#else
120
        tss_storage* get_thread_tss_data() override
121
        {
122
            return nullptr;
123
        }
124
#endif
125

126
#if defined(HPX_HAVE_THREAD_LOCAL_STORAGE)
127
        tss_storage* get_or_create_thread_tss_data() override
12✔
128
        {
129
            return pimpl_->get_thread_tss_data(true);
12✔
130
        }
131
#else
132
        tss_storage* get_or_create_thread_tss_data() override
133
        {
134
            return nullptr;
135
        }
136
#endif
137

138
        std::size_t& get_continuation_recursion_count() noexcept override
×
139
        {
140
            return pimpl_->get_continuation_recursion_count();
×
141
        }
142

143
    private:
144
        coroutine_impl* get_impl() noexcept override
8✔
145
        {
146
            return pimpl_;
8✔
147
        }
148
        coroutine_impl* pimpl_;
149
    };
150
}    // namespace hpx::threads::coroutines::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