Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: src/platform-posix.cc

Issue 20216003: Setting the thread name may fail, so don't assert that the result is 0. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index ff5f70addc5fe3ffdf32861c699df1e75a57beed..864e94c7e4f6896d61da24714332f3e2d55b35c8 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -502,12 +502,11 @@ Thread::~Thread() {
static void SetThreadName(const char* name) {
- int result = 0;
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
- result = pthread_set_name_np(pthread_self(), name);
+ pthread_set_name_np(pthread_self(), name);
#elif defined(__NetBSD__)
STATIC_ASSERT(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP);
- result = pthread_setname_np(pthread_self(), "%s", name);
+ pthread_setname_np(pthread_self(), "%s", name);
#elif defined(__APPLE__)
// pthread_setname_np is only available in 10.6 or later, so test
// for it at runtime.
@@ -520,14 +519,12 @@ static void SetThreadName(const char* name) {
// Mac OS X does not expose the length limit of the name, so hardcode it.
static const int kMaxNameLength = 63;
STATIC_ASSERT(Thread::kMaxThreadNameLength <= kMaxNameLength);
- result = dynamic_pthread_setname_np(name);
+ dynamic_pthread_setname_np(name);
#elif defined(PR_SET_NAME)
- result = prctl(PR_SET_NAME,
- reinterpret_cast<unsigned long>(name), // NOLINT
- 0, 0, 0);
+ prctl(PR_SET_NAME,
+ reinterpret_cast<unsigned long>(name), // NOLINT
+ 0, 0, 0);
#endif
- ASSERT_EQ(0, result);
- USE(result);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698