-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
In all wait methods we firstly check if the timer is not expired and then pass timeout - timer.elapsed() to wait of NetProvider. The wait of NetProvider expects a positive number (or -1 as infinity), but timeout - timer.elapsed() can actually be negative: for example, OS can reschedule the process right after timer.isExpired() call, so it will be actually expired when NetPovider.wait is called.
tntcxx/src/Client/Connector.hpp
Lines 188 to 194 in f9dae01
| while (!conn.hasError() && !conn.futureIsReady(future) && | |
| !timer.isExpired()) { | |
| if (m_NetProvider.wait(timeout - timer.elapsed()) != 0) { | |
| conn.setError(std::string("Failed to poll: ") + | |
| strerror(errno), errno); | |
| return -1; | |
| } |
Metadata
Metadata
Assignees
Labels
No labels