Skip to content

Commit 6e40561

Browse files
committed
Making sure HPX_WITH_THREAD_BACKTRACE_ON_SUSPENSION compiles
1 parent bd9e3cb commit 6e40561

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,20 @@ jobs:
224224
/hpx/source \
225225
-G "Ninja" \
226226
-DCMAKE_BUILD_TYPE=Debug \
227+
-DCMAKE_CXX_CLANG_TIDY=clang-tidy \
228+
-DCMAKE_CXX_FLAGS="-fcolor-diagnostics" \
229+
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
227230
-DHPX_WITH_MALLOC=system \
228231
-DHPX_WITH_FETCH_ASIO=Off \
229232
-DHPX_WITH_DATAPAR_BACKEND=VC \
230233
-DHPX_WITH_GIT_COMMIT=${CIRCLE_SHA1} \
231234
-DHPX_WITH_GIT_BRANCH="${CIRCLE_BRANCH}" \
232235
-DHPX_WITH_GIT_TAG="${CIRCLE_TAG}" \
233236
-DHPX_WITH_TOOLS=On \
234-
-DCMAKE_CXX_FLAGS="-fcolor-diagnostics" \
235237
-DHPX_WITH_TESTS_HEADERS=On \
236238
-DHPX_WITH_COMPILER_WARNINGS=On \
237239
-DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=On \
238240
-DHPX_WITH_DEPRECATION_WARNINGS=On \
239-
-DCMAKE_CXX_CLANG_TIDY=clang-tidy \
240-
-DHPX_WITH_THREAD_LOCAL_STORAGE=On \
241241
-DHPX_WITH_STACKTRACES_STATIC_SYMBOLS=On \
242242
-DHPX_WITH_STACKTRACES_DEMANGLE_SYMBOLS=Off \
243243
-DHPX_WITH_TESTS_DEBUG_LOG=On \
@@ -246,9 +246,9 @@ jobs:
246246
-DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On \
247247
-DHPX_LOGGING_WITH_SEPARATE_DESTINATIONS=Off \
248248
-DHPX_WITH_THREAD_DEBUG_INFO=On \
249+
-DHPX_WITH_THREAD_LOCAL_STORAGE=On \
249250
-DHPX_COMMAND_LINE_HANDLING_WITH_JSON_CONFIGURATION_FILES=On \
250251
-DHPX_WITH_FETCH_JSON=On \
251-
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
252252
-DHPX_WITH_DOCUMENTATION=On \
253253
-DHPX_WITH_DOCUMENTATION_OUTPUT_FORMATS="${DOCUMENTATION_OUTPUT_FORMATS}" \
254254
-DHPX_WITH_TESTS_COMMAND_LINE=--hpx:queuing=local-workrequesting-fifo

.jenkins/lsu/env-clang-14.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON"
3737
# Make sure HWLOC does not report 'cores'. This is purely an option to enable
3838
# testing the topology code under conditions close to those on FreeBSD.
3939
configure_extra_options+=" -DHPX_TOPOLOGY_WITH_ADDITIONAL_HWLOC_TESTING=ON"
40+
41+
configure_extra_options+=" -DHPX_WITH_THREAD_BACKTRACE_ON_SUSPENSION=ON"
42+
configure_extra_options+=" -DHPX_WITH_THREAD_FULLBACKTRACE_ON_SUSPENSION=ON"

libs/core/threading_base/include/hpx/threading_base/detail/reset_backtrace.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010

1111
#ifdef HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION
1212

13-
#include <hpx/modules/debugging.hpp>
1413
#include <hpx/modules/errors.hpp>
1514
#include <hpx/threading_base/threading_base_fwd.hpp>
1615

1716
#include <memory>
17+
#ifdef HPX_HAVE_THREAD_FULLBACKTRACE_ON_SUSPENSION
1818
#include <string>
19+
#endif
20+
21+
#include <hpx/config/warnings_prefix.hpp>
1922

2023
namespace hpx::threads::detail {
2124

@@ -40,4 +43,6 @@ namespace hpx::threads::detail {
4043
};
4144
} // namespace hpx::threads::detail
4245

46+
#include <hpx/config/warnings_suffix.hpp>
47+
4348
#endif // HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION

libs/core/threading_base/include/hpx/threading_base/thread_data.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ namespace hpx::threads {
422422
spinlock_pool::spinlock_for(this));
423423

424424
std::string bt;
425-
if (0 != backtrace_)
425+
if (nullptr != backtrace_)
426426
{
427427
#ifdef HPX_HAVE_THREAD_FULLBACKTRACE_ON_SUSPENSION
428428
bt = *backtrace_;

libs/core/threading_base/src/detail/reset_backtrace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020-2022 Hartmut Kaiser
1+
// Copyright (c) 2020-2023 Hartmut Kaiser
22
//
33
// SPDX-License-Identifier: BSL-1.0
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -36,7 +36,7 @@ namespace hpx::threads::detail {
3636

3737
reset_backtrace::~reset_backtrace()
3838
{
39-
threads::set_thread_backtrace(id_, 0, ec_);
39+
threads::set_thread_backtrace(id_, nullptr, ec_);
4040
}
4141
} // namespace hpx::threads::detail
4242

libs/core/threading_base/src/execution_agent.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ namespace hpx::threads {
167167
id.noref(), threads::thread_description(desc));
168168
#endif
169169
#if defined(HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION)
170-
[[maybe_unused]] threads::detail::reset_backtrace reset_bt(id);
170+
[[maybe_unused]] threads::detail::reset_backtrace reset_bt(
171+
id.noref());
171172
#endif
172173
#if defined(HPX_HAVE_VERIFY_LOCKS)
173174
[[maybe_unused]] auto held_locks = hpx::experimental::scope_exit(

libs/core/threading_base/src/thread_helpers.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ namespace hpx::this_thread {
441441
threads::thread_self& self = threads::get_self();
442442

443443
// keep alive
444-
threads::thread_id_ref_type id = self.get_outer_thread_id();
444+
threads::thread_id_ref_type const id = self.get_outer_thread_id();
445445

446446
// handle interruption, if needed
447447
threads::interruption_point(id.noref(), ec);
@@ -451,16 +451,16 @@ namespace hpx::this_thread {
451451
threads::thread_restart_state statex;
452452

453453
{
454-
// verify that there are no more registered locks for this OS-thread
455454
#ifdef HPX_HAVE_VERIFY_LOCKS
455+
// verify that there are no more registered locks for this OS-thread
456456
util::verify_no_locks();
457457
#endif
458458
#ifdef HPX_HAVE_THREAD_DESCRIPTION
459459
threads::detail::reset_lco_description desc(
460460
id.noref(), description, ec);
461461
#endif
462462
#ifdef HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION
463-
threads::detail::reset_backtrace bt(id, ec);
463+
threads::detail::reset_backtrace bt(id.noref(), ec);
464464
#endif
465465
// We might need to dispatch 'nextid' to it's correct scheduler only
466466
// if our current scheduler is the same, we should yield to the id
@@ -512,7 +512,7 @@ namespace hpx::this_thread {
512512
threads::thread_self& self = threads::get_self();
513513

514514
// keep alive
515-
threads::thread_id_ref_type id = self.get_outer_thread_id();
515+
threads::thread_id_ref_type const id = self.get_outer_thread_id();
516516

517517
// handle interruption, if needed
518518
threads::interruption_point(id.noref(), ec);
@@ -532,7 +532,7 @@ namespace hpx::this_thread {
532532
id.noref(), description, ec);
533533
#endif
534534
#ifdef HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION
535-
threads::detail::reset_backtrace bt(id, ec);
535+
threads::detail::reset_backtrace bt(id.noref(), ec);
536536
#endif
537537
std::atomic<bool> timer_started(false);
538538
threads::thread_id_ref_type const timer_id =

0 commit comments

Comments
 (0)