Тупик при статически инициализированном jthread, вызывающем std::stacktrace_entry::descriptionC++

Программы на C++. Форум разработчиков
Гость
Тупик при статически инициализированном jthread, вызывающем std::stacktrace_entry::description

Сообщение Гость »

Приведенный ниже код приводит к взаимоблокировке при выходе из main()
#include
#include
#include
#include
#include

using namespace std::chrono_literals;

std::stacktrace trace;
std::binary_semaphore sema{ 0 };

void g()
{
trace = std::stacktrace::current();
}

void f()
{
g();
}

void get()
{
static std::jthread worker{ [] {
sema.acquire();
for (auto& e : trace) {
std::this_thread::sleep_for(50ms);
std::cout

Подробнее здесь: https://stackoverflow.com/questions/782 ... descriptio

Вернуться в «C++»