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

Unified Diff: base/threading/platform_thread_posix.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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 | « base/threading/platform_thread_mac.mm ('k') | base/threading/platform_thread_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_posix.cc
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index 3dbdc9808752c2b1411aa516fcf5b8bf328fa88c..0d821a9b7ad803099817e16be62a6014a79f9e04 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -13,7 +13,6 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/safe_strerror_posix.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread_internal_posix.h"
#include "base/threading/thread_id_name_manager.h"
@@ -229,7 +228,7 @@ void PlatformThread::Join(PlatformThreadHandle thread_handle) {
// the thread referred to by |thread_handle| may still be running long-lived /
// blocking tasks.
base::ThreadRestrictions::AssertIOAllowed();
- CHECK_EQ(0, pthread_join(thread_handle.handle_, NULL));
+ CHECK_EQ(0, pthread_join(thread_handle.platform_handle(), NULL));
}
// Mac has its own Set/GetThreadPriority() implementations.
@@ -250,13 +249,13 @@ void PlatformThread::SetThreadPriority(PlatformThreadHandle handle,
// Linux/NPTL implementation of POSIX threads, the nice value is a per-thread
// attribute". Also, 0 is prefered to the current thread id since it is
// equivalent but makes sandboxing easier (https://crbug.com/399473).
- DCHECK_NE(handle.id_, kInvalidThreadId);
+ DCHECK_NE(handle.id(), kInvalidThreadId);
const int nice_setting = internal::ThreadPriorityToNiceValue(priority);
const PlatformThreadId current_id = PlatformThread::CurrentId();
- if (setpriority(PRIO_PROCESS, handle.id_ == current_id ? 0 : handle.id_,
+ if (setpriority(PRIO_PROCESS, handle.id() == current_id ? 0 : handle.id(),
nice_setting)) {
- DVPLOG(1) << "Failed to set nice value of thread (" << handle.id_ << ") to "
- << nice_setting;
+ DVPLOG(1) << "Failed to set nice value of thread (" << handle.id()
+ << ") to " << nice_setting;
}
#endif // defined(OS_NACL)
}
@@ -274,15 +273,15 @@ ThreadPriority PlatformThread::GetThreadPriority(PlatformThreadHandle handle) {
return platform_specific_priority;
}
- DCHECK_NE(handle.id_, kInvalidThreadId);
+ DCHECK_NE(handle.id(), kInvalidThreadId);
const PlatformThreadId current_id = PlatformThread::CurrentId();
// Need to clear errno before calling getpriority():
// http://man7.org/linux/man-pages/man2/getpriority.2.html
errno = 0;
int nice_value =
- getpriority(PRIO_PROCESS, handle.id_ == current_id ? 0 : handle.id_);
+ getpriority(PRIO_PROCESS, handle.id() == current_id ? 0 : handle.id());
if (errno != 0) {
- DVPLOG(1) << "Failed to get nice value of thread (" << handle.id_ << ")";
+ DVPLOG(1) << "Failed to get nice value of thread (" << handle.id() << ")";
return ThreadPriority::NORMAL;
}
« no previous file with comments | « base/threading/platform_thread_mac.mm ('k') | base/threading/platform_thread_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698