fix regression: llarp::Context::CallSafe was not deferring call on startup

pull/1610/head
Jeff Becker 3 years ago
parent 6d12a7a712
commit 3e7137ad96
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -27,7 +27,7 @@ namespace llarp
{ {
if (!loop) if (!loop)
return false; return false;
loop->call(std::move(f)); loop->call_soon(std::move(f));
return true; return true;
} }

@ -370,6 +370,7 @@ namespace llarp::uv
{ {
if (m_EventLoopThreadID) if (m_EventLoopThreadID)
return *m_EventLoopThreadID == std::this_thread::get_id(); return *m_EventLoopThreadID == std::this_thread::get_id();
// assume we are in it because we haven't started up yet
return true; return true;
} }

@ -6,7 +6,7 @@
llarp::RuntimeOptions opts = {false, false, false}; llarp::RuntimeOptions opts = {false, false, false};
/// make a llarp_main* with 1 endpoint that specifies a keyfile /// make a context with 1 endpoint that specifies a keyfile
static std::shared_ptr<llarp::Context> static std::shared_ptr<llarp::Context>
make_context(std::optional<fs::path> keyfile) make_context(std::optional<fs::path> keyfile)
{ {

Loading…
Cancel
Save