fix bug in condition variable using invalid timeout

This commit is contained in:
somdoron 2016-01-18 15:30:07 +02:00
parent 1a502cc190
commit 4bfe2ec686

View File

@ -164,6 +164,12 @@ namespace zmq
timeout.tv_sec += timeout_ / 1000;
timeout.tv_nsec += (timeout_ % 1000) * 1000000;
if (timeout.tv_nsec > 1E9) {
timeout.tv_sec++;
timeout.tv_nsec -= 1E9;
}
rc = pthread_cond_timedwait (&cond, mutex_->get_mutex (), &timeout);
}
else