From e62a24b1abf859593b15f2dd38bb521a1e1682e1 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Thu, 16 Nov 2023 03:10:39 -0500 Subject: [PATCH] Create thread context for the main thread. We probably should also do it for any random thread... but this mostly would be to prevent crashes... as there's no Alepha thread object associated with the --- Thread.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Thread.cc b/Thread.cc index d5f9dc0..739fd60 100644 --- a/Thread.cc +++ b/Thread.cc @@ -90,6 +90,11 @@ namespace Alepha::Hydrogen::detail::Thread_m state()->interruption_point(); } + static auto init= Utility::enroll <=[] + { + state()= std::make_shared< ThreadState >(); + }; + struct Thread::Impl { std::thread thr;