jenrryyou commented on code in PR #2086: URL: https://github.com/apache/brpc/pull/2086#discussion_r1073469170
########## src/bthread/butex.cpp: ########## @@ -137,7 +137,21 @@ static void wakeup_pthread(ButexPthreadWaiter* pw) { bool erase_from_butex(ButexWaiter*, bool, WaiterState); -int wait_pthread(ButexPthreadWaiter& pw, timespec* ptimeout) { +int wait_pthread(ButexPthreadWaiter& pw, const timespec* abstime) { + timespec * ptimeout = NULL; + timespec timeout; + int64_t timeout_us; + + if (abstime != NULL) { + timeout_us = butil::timespec_to_microseconds(*abstime) - butil::gettimeofday_us(); + if (timeout_us < MIN_SLEEP_US) { + errno = ETIMEDOUT; + return -1; Review Comment: 已经修改,感谢指出 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org