mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 17:29:24 +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_requestMutex);
|
||||||
uv_mutex_init_checked(&m_condMutex);
|
uv_mutex_init_checked(&m_condMutex);
|
||||||
|
|
||||||
err = uv_cond_init(&m_cond);
|
uv_cond_init_checked(&m_cond);
|
||||||
if (err) {
|
|
||||||
LOGERR(1, "failed to create cond, error " << uv_err_name(err));
|
|
||||||
panic();
|
|
||||||
}
|
|
||||||
|
|
||||||
err = uv_thread_create(&m_loopThread, loop, this);
|
err = uv_thread_create(&m_loopThread, loop, this);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -205,6 +205,15 @@ std::istream& operator>>(std::istream& s, hash& h)
|
||||||
return s;
|
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)
|
void uv_mutex_init_checked(uv_mutex_t* mutex)
|
||||||
{
|
{
|
||||||
const int result = uv_mutex_init(mutex);
|
const int result = uv_mutex_init(mutex);
|
||||||
|
|
|
@ -57,6 +57,7 @@ private:
|
||||||
|
|
||||||
typedef RWLock<true> WriteLock;
|
typedef RWLock<true> WriteLock;
|
||||||
|
|
||||||
|
void uv_cond_init_checked(uv_cond_t* cond);
|
||||||
void uv_mutex_init_checked(uv_mutex_t* mutex);
|
void uv_mutex_init_checked(uv_mutex_t* mutex);
|
||||||
void uv_rwlock_init_checked(uv_rwlock_t* lock);
|
void uv_rwlock_init_checked(uv_rwlock_t* lock);
|
||||||
uv_loop_t* uv_default_loop_checked();
|
uv_loop_t* uv_default_loop_checked();
|
||||||
|
|
Loading…
Reference in a new issue