Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize timeout judgement according to different condition (#187)
* optimize timeout judgement according to different condition Under the condition that "hasToWait && wait_timeout", there is no need to re-calc hasData to judge timeout because predicate already include the logic. We only need do it if hasToWait && !wait_timeout. This commit optimize timeout judgement which slightly improve the performance in some conditions Signed-off-by: jwang <jing.j.wang@intel.com> * replace cv->wait(lock) with cv->wait(lock, predicate) and simplify timeout logic Signed-off-by: jwang <jing.j.wang@intel.com> * Improve logic to return TIMEOUT when not hasData && timeout->sec/nsec==0 Signed-off-by: jwang <jing.j.wang@intel.com>
- Loading branch information