mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-31 01:43:02 +08:00
Merge pull request #1714 from somdoron/master
problem: condition variable setting invalid timeout
This commit is contained in:
commit
9ebb5cc911
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user