mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-22 19:39:22 +00:00
Removed unnecessary async call
This commit is contained in:
parent
2c5cfb6442
commit
f149613d54
2 changed files with 2 additions and 7 deletions
|
@ -396,7 +396,6 @@ RandomX_Hasher_RPC::RandomX_Hasher_RPC(p2pool* pool)
|
||||||
GetLoopUserData(&m_loop);
|
GetLoopUserData(&m_loop);
|
||||||
|
|
||||||
uv_async_init_checked(&m_loop, &m_shutdownAsync, on_shutdown);
|
uv_async_init_checked(&m_loop, &m_shutdownAsync, on_shutdown);
|
||||||
uv_async_init_checked(&m_loop, &m_kickTheLoopAsync, nullptr);
|
|
||||||
m_shutdownAsync.data = this;
|
m_shutdownAsync.data = this;
|
||||||
|
|
||||||
uv_mutex_init_checked(&m_requestMutex);
|
uv_mutex_init_checked(&m_requestMutex);
|
||||||
|
@ -456,8 +455,8 @@ bool RandomX_Hasher_RPC::calculate(const void* data_ptr, size_t size, uint64_t h
|
||||||
",\"block_blob\":\"" << log::hex_buf(data, size) << '"' <<
|
",\"block_blob\":\"" << log::hex_buf(data, size) << '"' <<
|
||||||
",\"seed_hash\":\"\"}}\0";
|
",\"seed_hash\":\"\"}}\0";
|
||||||
|
|
||||||
volatile int result = 0;
|
std::atomic<int> result{ 0 };
|
||||||
volatile bool done = false;
|
std::atomic<bool> done{ false };
|
||||||
|
|
||||||
const Params& params = m_pool->params();
|
const Params& params = m_pool->params();
|
||||||
const Params::Host& host = m_pool->current_host();
|
const Params::Host& host = m_pool->current_host();
|
||||||
|
@ -485,8 +484,6 @@ bool RandomX_Hasher_RPC::calculate(const void* data_ptr, size_t size, uint64_t h
|
||||||
uv_cond_signal(&m_cond);
|
uv_cond_signal(&m_cond);
|
||||||
}, &m_loop);
|
}, &m_loop);
|
||||||
|
|
||||||
uv_async_send(&m_kickTheLoopAsync);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
MutexLock lock2(m_condMutex);
|
MutexLock lock2(m_condMutex);
|
||||||
while (!done) {
|
while (!done) {
|
||||||
|
|
|
@ -115,13 +115,11 @@ private:
|
||||||
uv_cond_t m_cond;
|
uv_cond_t m_cond;
|
||||||
|
|
||||||
uv_async_t m_shutdownAsync;
|
uv_async_t m_shutdownAsync;
|
||||||
uv_async_t m_kickTheLoopAsync;
|
|
||||||
|
|
||||||
static void on_shutdown(uv_async_t* async)
|
static void on_shutdown(uv_async_t* async)
|
||||||
{
|
{
|
||||||
RandomX_Hasher_RPC* server = reinterpret_cast<RandomX_Hasher_RPC*>(async->data);
|
RandomX_Hasher_RPC* server = reinterpret_cast<RandomX_Hasher_RPC*>(async->data);
|
||||||
uv_close(reinterpret_cast<uv_handle_t*>(&server->m_shutdownAsync), nullptr);
|
uv_close(reinterpret_cast<uv_handle_t*>(&server->m_shutdownAsync), nullptr);
|
||||||
uv_close(reinterpret_cast<uv_handle_t*>(&server->m_kickTheLoopAsync), nullptr);
|
|
||||||
|
|
||||||
delete GetLoopUserData(&server->m_loop, false);
|
delete GetLoopUserData(&server->m_loop, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue