Commit ad509518 authored by Oskar Sundbom's avatar Oskar Sundbom Committed by Commit Bot

CHECK that SimpleThread is able to create a thread

I stumbled on a couple of crashes where it looks like
the audio thread is deadlocked on the event_.Wait()
call. From what I can tell, there's no way to recover
from a fail thread creation, so any thread that calls
SimpleThread::Start() has a chance of freezing
indefinitely.

This was changed[1] from a CHECK to a DCHECK way back in
2011. There shouldn't be any valid cases where thread
creation fails, so it's probably better to get a clean
crash as soon as this happens, than possibly getting a
crash dump much later, provided a watchdog kicks in.

[1] https://codereview.chromium.org/8368009

Bug: 854154
Change-Id: I72f7318642a39b0e1b23964f0841423bc9e87496
Reviewed-on: https://chromium-review.googlesource.com/1104679Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Oskar Sundbom <ossu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568449}
parent 7822973c
...@@ -53,7 +53,7 @@ void SimpleThread::StartAsync() { ...@@ -53,7 +53,7 @@ void SimpleThread::StartAsync() {
&thread_, options_.priority) &thread_, options_.priority)
: PlatformThread::CreateNonJoinableWithPriority( : PlatformThread::CreateNonJoinableWithPriority(
options_.stack_size, this, options_.priority); options_.stack_size, this, options_.priority);
DCHECK(success); CHECK(success);
} }
PlatformThreadId SimpleThread::tid() { PlatformThreadId SimpleThread::tid() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment