Permit current queue reference to be null on sequence checker creation
This makes it not an error to bind a SequenceChecker before the global TaskQueueBase::Current() is set. Unbreaks the SDP integration fuzzer. Bug: webrtc:13374 Change-Id: Ic4c23fa29f4598290cf9196550e5133ba753f44f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237620 Reviewed-by: Niels Moller <nisse@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35341}
This commit is contained in:
parent
5fb11901f0
commit
b8f7ef1c1b
@ -51,7 +51,7 @@ bool SequenceCheckerImpl::IsCurrent() const {
|
|||||||
valid_system_queue_ = current_system_queue;
|
valid_system_queue_ = current_system_queue;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (valid_queue_ || current_queue) {
|
if (valid_queue_) {
|
||||||
return valid_queue_ == current_queue;
|
return valid_queue_ == current_queue;
|
||||||
}
|
}
|
||||||
if (valid_system_queue_ && valid_system_queue_ == current_system_queue) {
|
if (valid_system_queue_ && valid_system_queue_ == current_system_queue) {
|
||||||
|
|||||||
@ -187,6 +187,9 @@ TEST(UniqueNumberGeneratorDeathTest, FailsWhenUsedInWrongContext) {
|
|||||||
// thread/sequence checkers will pick up a different thread environment than
|
// thread/sequence checkers will pick up a different thread environment than
|
||||||
// `fake_task_queue` will represent.
|
// `fake_task_queue` will represent.
|
||||||
UniqueNumberGenerator<uint32_t> generator;
|
UniqueNumberGenerator<uint32_t> generator;
|
||||||
|
|
||||||
|
// Instantiate a fake task queue that will register itself as the current tq.
|
||||||
|
FakeTaskQueue initial_fake_task_queue;
|
||||||
// Generate an ID on the current thread. This causes the generator to attach
|
// Generate an ID on the current thread. This causes the generator to attach
|
||||||
// to the current thread context.
|
// to the current thread context.
|
||||||
generator.GenerateNumber();
|
generator.GenerateNumber();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user