Add logging to Client::receive.

GitOrigin-RevId: 2cb36c61e186a0e598dd5ce3a330d1a0baa884c3
This commit is contained in:
levlam 2018-10-31 15:09:25 +03:00
parent b886016254
commit 6b3b190037

View File

@ -157,11 +157,13 @@ class Client::Impl final {
}
Response receive(double timeout) {
VLOG(td_requests) << "Begin to wait for updates with timeout " << timeout;
auto is_locked = receive_lock_.exchange(true);
CHECK(!is_locked);
auto response = receive_unlocked(timeout);
is_locked = receive_lock_.exchange(false);
CHECK(is_locked);
LOG(td_requests) << "End to wait for updates, returning object " << response.id << ' ' << response.object.get();
return response;
}