|
@@ -1052,7 +1052,7 @@ struct pool *add_pool(void)
|
|
|
mutex_init(&pool->last_work_lock);
|
|
mutex_init(&pool->last_work_lock);
|
|
|
mutex_init(&pool->pool_lock);
|
|
mutex_init(&pool->pool_lock);
|
|
|
mutex_init(&pool->pool_test_lock);
|
|
mutex_init(&pool->pool_test_lock);
|
|
|
- if (unlikely(pthread_cond_init(&pool->cr_cond, NULL)))
|
|
|
|
|
|
|
+ if (unlikely(pthread_cond_init(&pool->cr_cond, bfg_condattr)))
|
|
|
quit(1, "Failed to pthread_cond_init in add_pool");
|
|
quit(1, "Failed to pthread_cond_init in add_pool");
|
|
|
cglock_init(&pool->data_lock);
|
|
cglock_init(&pool->data_lock);
|
|
|
mutex_init(&pool->stratum_lock);
|
|
mutex_init(&pool->stratum_lock);
|
|
@@ -9127,7 +9127,6 @@ static struct work *hash_pop(void)
|
|
|
{
|
|
{
|
|
|
struct work *work = NULL, *tmp;
|
|
struct work *work = NULL, *tmp;
|
|
|
int hc;
|
|
int hc;
|
|
|
- struct timespec ts;
|
|
|
|
|
|
|
|
|
|
retry:
|
|
retry:
|
|
|
mutex_lock(stgd_lock);
|
|
mutex_lock(stgd_lock);
|
|
@@ -9145,9 +9144,9 @@ retry:
|
|
|
staged_full = false; // Let it fill up before triggering an underrun again
|
|
staged_full = false; // Let it fill up before triggering an underrun again
|
|
|
no_work = true;
|
|
no_work = true;
|
|
|
}
|
|
}
|
|
|
- ts = (struct timespec){ .tv_sec = opt_log_interval, };
|
|
|
|
|
pthread_cond_signal(&gws_cond);
|
|
pthread_cond_signal(&gws_cond);
|
|
|
- if (ETIMEDOUT == pthread_cond_timedwait(&getq->cond, stgd_lock, &ts))
|
|
|
|
|
|
|
+ const struct timeval tv = { .tv_sec = opt_log_interval, };
|
|
|
|
|
+ if (ETIMEDOUT == bfg_cond_timedwait(&getq->cond, stgd_lock, &tv))
|
|
|
{
|
|
{
|
|
|
run_cmd(cmd_idle);
|
|
run_cmd(cmd_idle);
|
|
|
pthread_cond_signal(&gws_cond);
|
|
pthread_cond_signal(&gws_cond);
|
|
@@ -12287,10 +12286,10 @@ int main(int argc, char *argv[])
|
|
|
rwlock_init(&devices_lock);
|
|
rwlock_init(&devices_lock);
|
|
|
|
|
|
|
|
mutex_init(&lp_lock);
|
|
mutex_init(&lp_lock);
|
|
|
- if (unlikely(pthread_cond_init(&lp_cond, NULL)))
|
|
|
|
|
|
|
+ if (unlikely(pthread_cond_init(&lp_cond, bfg_condattr)))
|
|
|
quit(1, "Failed to pthread_cond_init lp_cond");
|
|
quit(1, "Failed to pthread_cond_init lp_cond");
|
|
|
|
|
|
|
|
- if (unlikely(pthread_cond_init(&gws_cond, NULL)))
|
|
|
|
|
|
|
+ if (unlikely(pthread_cond_init(&gws_cond, bfg_condattr)))
|
|
|
quit(1, "Failed to pthread_cond_init gws_cond");
|
|
quit(1, "Failed to pthread_cond_init gws_cond");
|
|
|
|
|
|
|
|
notifier_init(submit_waiting_notifier);
|
|
notifier_init(submit_waiting_notifier);
|