mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-17 08:17:55 +00:00
Added uv_cond_init_checked
This commit is contained in:
parent
945de348f3
commit
4733f46a28
3 changed files with 11 additions and 5 deletions
|
@ -389,11 +389,7 @@ RandomX_Hasher_RPC::RandomX_Hasher_RPC(p2pool* pool)
|
|||
uv_mutex_init_checked(&m_requestMutex);
|
||||
uv_mutex_init_checked(&m_condMutex);
|
||||
|
||||
err = uv_cond_init(&m_cond);
|
||||
if (err) {
|
||||
LOGERR(1, "failed to create cond, error " << uv_err_name(err));
|
||||
panic();
|
||||
}
|
||||
uv_cond_init_checked(&m_cond);
|
||||
|
||||
err = uv_thread_create(&m_loopThread, loop, this);
|
||||
if (err) {
|
||||
|
|
|
@ -205,6 +205,15 @@ std::istream& operator>>(std::istream& s, hash& h)
|
|||
return s;
|
||||
}
|
||||
|
||||
void uv_cond_init_checked(uv_cond_t* cond)
|
||||
{
|
||||
const int result = uv_cond_init(cond);
|
||||
if (result) {
|
||||
LOGERR(1, "failed to create conditional variable, error " << uv_err_name(result));
|
||||
panic();
|
||||
}
|
||||
}
|
||||
|
||||
void uv_mutex_init_checked(uv_mutex_t* mutex)
|
||||
{
|
||||
const int result = uv_mutex_init(mutex);
|
||||
|
|
|
@ -57,6 +57,7 @@ private:
|
|||
|
||||
typedef RWLock<true> WriteLock;
|
||||
|
||||
void uv_cond_init_checked(uv_cond_t* cond);
|
||||
void uv_mutex_init_checked(uv_mutex_t* mutex);
|
||||
void uv_rwlock_init_checked(uv_rwlock_t* lock);
|
||||
uv_loop_t* uv_default_loop_checked();
|
||||
|
|
Loading…
Reference in a new issue