Change ObjCNetworkMonitor::OnPathUpdate to use PostTask
Removes use of AsyncInvoker, replaced with PendingTaskSafetyFlag. The latter is extended to support creation on a different thread than where it will be used, and to support stop and restart. Bug: webrtc:12339 Change-Id: I28b6e09b1542f50037e842ef5fe3a47d15704b46 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211002 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33432}
This commit is contained in:
@ -24,6 +24,11 @@ void PendingTaskSafetyFlag::SetNotAlive() {
|
||||
alive_ = false;
|
||||
}
|
||||
|
||||
void PendingTaskSafetyFlag::SetAlive() {
|
||||
RTC_DCHECK_RUN_ON(&main_sequence_);
|
||||
alive_ = true;
|
||||
}
|
||||
|
||||
bool PendingTaskSafetyFlag::alive() const {
|
||||
RTC_DCHECK_RUN_ON(&main_sequence_);
|
||||
return alive_;
|
||||
|
||||
@ -62,6 +62,7 @@ class PendingTaskSafetyFlag : public rtc::RefCountInterface {
|
||||
~PendingTaskSafetyFlag() = default;
|
||||
|
||||
void SetNotAlive();
|
||||
void SetAlive();
|
||||
bool alive() const;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user