You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Verify that there are no more registered locks for this
// OS-thread. This will throw if there are still any locks held.
util::force_error_on_lock();
// run and free all registered exit functions for this thread
auto* p = get_self_id_data();
p->run_thread_exit_callbacks();
p->free_thread_exit_callbacks();
returnthreads::thread_result_type(
threads::thread_schedule_state::terminated,
threads::invalid_thread_id);
}
};
I should add that previously the callbacks were never executed, so using add_thread_exit_callback would cause an assertion failure later on thread destruction (L163), due to this sequence of calls:
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure that hpx_main is launched as a thread_function, so that exit callbacks are respected, and the following code will actually be used:
hpx/libs/core/threading_base/include/hpx/threading_base/register_thread.hpp
Lines 28 to 52 in e7c31a4
I should add that previously the callbacks were never executed, so using add_thread_exit_callback would cause an assertion failure later on thread destruction (L163), due to this sequence of calls:
hpx/libs/core/threading_base/src/thread_data.cpp
Lines 107 to 111 in e7c31a4
hpx/libs/core/threading_base/src/thread_data.cpp
Lines 157 to 166 in e7c31a4
@hkaiser Let me know if this is a good idea, and whether you'd like me to add a regression test.