Fixes to posting delayed process tasks in SSCC.

The task queue based SendSideCongestionController (SSCC) was accessing
a unique pointer to the task queue from the task queue itself. This
triggered a tsan check failure when resetting the same unique pointer.

Also move declaration of SSCC member in RtpTransportControllerSend last,
to ensure that it, and its TaskQueue, are destroyed before other members.

Bug: webrtc:8415
Change-Id: I75c93f41deab637f7e4766ac4b61713c86f866e9
Reviewed-on: https://webrtc-review.googlesource.com/62143
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22478}
This commit is contained in:
Sebastian Jansson
2018-03-16 15:36:37 +01:00
committed by Commit Bot
parent 4ccc1c4bb6
commit 317a522876
5 changed files with 70 additions and 31 deletions

View File

@ -130,19 +130,18 @@ class SendSideCongestionController
protected:
// TODO(srte): The tests should be rewritten to not depend on internals and
// these functions should be removed.
// Post tasks that are normally delayed. This allows unit tests to trigger
// process updates immediately.
void PostDelayedTasksForTest();
// Post periodic tasks just once. This allows unit tests to trigger process
// updates immediately.
void PostPeriodicTasksForTest();
// Waits for outstanding tasks to be finished. This allos unit tests to ensure
// that expected callbacks has be called.
// that expected callbacks has been called.
void WaitOnTasksForTest();
private:
void MaybeCreateControllers();
void StartProcess() RTC_RUN_ON(task_queue_);
void ProcessTask();
void StartPacerQueueUpdate();
void PacerQueueUpdateTask();
void StartProcessPeriodicTasks() RTC_RUN_ON(task_queue_);
void UpdateControllerWithTimeInterval() RTC_RUN_ON(task_queue_);
void UpdatePacerQueue() RTC_RUN_ON(task_queue_);
void UpdateStreamsConfig() RTC_RUN_ON(task_queue_);
void MaybeUpdateOutstandingData();