mirror of https://github.com/oxen-io/lokinet
more cleanup
This commit is contained in:
parent
b286230d40
commit
8455d5d1cf
|
@ -204,6 +204,8 @@ __ ___ ____ _ _ ___ _ _ ____
|
|||
llarp::LogInfo("starting up");
|
||||
mainloop = llarp_make_ev_loop();
|
||||
|
||||
mainloop->set_logic(logic);
|
||||
|
||||
crypto = std::make_unique< sodium::CryptoLibSodium >();
|
||||
cryptoManager = std::make_unique< CryptoManager >(crypto.get());
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ void
|
|||
llarp_ev_loop_run_single_process(llarp_ev_loop_ptr ev,
|
||||
std::shared_ptr< llarp::Logic > logic)
|
||||
{
|
||||
ev->set_logic(logic);
|
||||
while(ev->running())
|
||||
{
|
||||
ev->update_time();
|
||||
|
|
|
@ -806,8 +806,7 @@ namespace libuv
|
|||
m_LogicCaller.data = this;
|
||||
uv_async_init(&m_Impl, &m_LogicCaller, [](uv_async_t* h) {
|
||||
Loop* l = static_cast< Loop* >(h->data);
|
||||
Queue_t* jobs = l->m_LogicCalls.load();
|
||||
l->m_LogicCalls.store(new Queue_t());
|
||||
Queue_t* jobs = l->m_LogicCalls.exchange(new Queue_t());
|
||||
while(not jobs->empty())
|
||||
{
|
||||
jobs->front()();
|
||||
|
|
|
@ -93,7 +93,14 @@ namespace llarp
|
|||
metrics::TimerGuard g("logic",
|
||||
std::string(TAG) + ":" + std::to_string(LINE));
|
||||
#endif
|
||||
self->m_Killer.TryAccess(func);
|
||||
if(self->m_Queue)
|
||||
{
|
||||
func();
|
||||
}
|
||||
else
|
||||
{
|
||||
self->m_Killer.TryAccess(func);
|
||||
}
|
||||
};
|
||||
if(can_flush())
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <crypto/crypto.hpp>
|
||||
#include <crypto/crypto_libsodium.hpp>
|
||||
#include <ev/ev.h>
|
||||
#include <ev/ev.hpp>
|
||||
#include <net/net.hpp>
|
||||
#include <util/thread/threading.hpp>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
|||
struct AbyssTestBase : public ::testing::Test
|
||||
{
|
||||
llarp::sodium::CryptoLibSodium crypto;
|
||||
llarp_ev_loop_ptr loop = nullptr;
|
||||
llarp_ev_loop_ptr loop = nullptr;
|
||||
std::shared_ptr< llarp::Logic > logic;
|
||||
abyss::httpd::BaseReqHandler* server = nullptr;
|
||||
abyss::http::JSONRPC* client = nullptr;
|
||||
|
@ -46,8 +46,9 @@ struct AbyssTestBase : public ::testing::Test
|
|||
void
|
||||
Start()
|
||||
{
|
||||
loop = llarp_make_ev_loop();
|
||||
logic = std::make_shared< llarp::Logic >();
|
||||
loop = llarp_make_ev_loop();
|
||||
logic = std::make_shared< llarp::Logic >();
|
||||
loop->set_logic(logic);
|
||||
sockaddr_in addr;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
addr.sin_port = htons((llarp::randint() % 2000) + 2000);
|
||||
|
|
Loading…
Reference in New Issue