Remove CHECK from GetThreadName.

It's safe for prctl() to fail, so we fall back on <noname> for thread names if we can't get one, instead of crashing.

BUG=
R=henrika@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/57529004

Cr-Commit-Position: refs/heads/master@{#9363}
This commit is contained in:
Tommi
2015-06-03 18:59:11 +02:00
parent b4c5eaa0d6
commit a9952cdd0e

View File

@@ -111,9 +111,9 @@ static std::string GetThreadId() {
// Return the current thread's name.
static std::string GetThreadName() {
char name[17];
CHECK_EQ(0, prctl(PR_GET_NAME, name)) << "prctl(PR_GET_NAME) failed";
name[16] = '\0';
char name[17] = {0};
if (prctl(PR_GET_NAME, name) != 0)
return std::string("<noname>");
return std::string(name);
}