rtc::Event: Add TimeDelta support.
This CL adds TimeDelta support to the rtc::Event, and updates the Wait implementations to work with the improved precision. Bug: webrtc:14366 Change-Id: Iefeb638b18176a34f4ed2a5131754a7b7e6c9e99 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272002 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Markus Handell <handellm@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37831}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
6b3927d949
commit
1d5be49ff2
@ -11,6 +11,7 @@
|
||||
#include "rtc_base/null_socket_server.h"
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/event.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
@ -21,7 +22,10 @@ bool NullSocketServer::Wait(int cms, bool process_io) {
|
||||
// Wait with the given timeout. Do not log a warning if we end up waiting for
|
||||
// a long time; that just means no one has any work for us, which is perfectly
|
||||
// legitimate.
|
||||
event_.Wait(/*give_up_after_ms=*/cms, /*warn_after_ms=*/Event::kForever);
|
||||
event_.Wait(/*give_up_after=*/cms == kForever
|
||||
? Event::kForever
|
||||
: webrtc::TimeDelta::Millis(cms),
|
||||
/*warn_after_ms=*/Event::kForever);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user