fixed one bug in thread_cond::wait there was one problem when computing timeout

This commit is contained in:
zsx 2018-03-19 10:49:45 +08:00
parent 919aabfa9c
commit 02719d7b6b
3 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,9 @@
修改历史列表:
-----------------------------------------------------------------------
512) 2018.3.20
512.1) bugfix: thread_cond.cpp 中的方法 wait 内部计算时间有误
511) 2018.3.19
511.1) feature: add redis_sentinel class

View File

@ -90,7 +90,7 @@ bool thread_cond::wait(long long microseconds /* = -1 */)
gettimeofday(&tv, NULL);
struct timespec ts;
ts.tv_sec = (time_t) (tv.tv_sec + microseconds) / SEC_TO_MIS;
ts.tv_sec = (time_t) (tv.tv_sec + microseconds / SEC_TO_MIS);
long long n = (tv.tv_usec + microseconds % SEC_TO_MIS) * MIS_TO_NS;
ts.tv_nsec = (long) n % SEC_TO_NS;
ts.tv_sec += (long) n / SEC_TO_NS;

View File

@ -1,4 +1,4 @@
%define release_id 87
%define release_id 88
Summary: The powerful c/c++ library and server framework
Name: acl-libs
@ -135,6 +135,9 @@ fi
%changelog
* Mon Mar 20 2018 zhengshuxin@qiyi.com 3.3.0-88-20180320.10
- fixed one bug in thread_cond::wait there was one problem when computing timeout
* Thu Mar 15 2018 zhengshuxin@qiyi.com 3.3.0-87-20180315.14
- move acl-master.json from acl-master to acl-tools