diff options
author | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-22 00:01:38 +0000 |
---|---|---|
committer | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-22 00:01:38 +0000 |
commit | 54e6ff8ff7194e231fa5dfe49304574f189495ca (patch) | |
tree | 896f968b6eccc67a7c123b257a36bb7fa3fb918c /base/synchronization | |
parent | 7fba3e550c138bf159589476c707a7e1d536055d (diff) | |
download | chromium_src-54e6ff8ff7194e231fa5dfe49304574f189495ca.zip chromium_src-54e6ff8ff7194e231fa5dfe49304574f189495ca.tar.gz chromium_src-54e6ff8ff7194e231fa5dfe49304574f189495ca.tar.bz2 |
Reland: base: Support setting thread priorities generically.
This patch supports setting priorities across platforms
at the PlatformThread level, by stashing thread id into the
thread handle on linux/android.
Since this adds more platform specific code, and #ifdefs
were starting to get unwieldy, all platform specific code
is moved into _platform.cc files, with the exception of the
'default' implementation, which stay in _posix.
BUG=170549
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=201202
Review URL: https://chromiumcodereview.appspot.com/12741012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/synchronization')
-rw-r--r-- | base/synchronization/lock_unittest.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/base/synchronization/lock_unittest.cc b/base/synchronization/lock_unittest.cc index e87571d..16144755 100644 --- a/base/synchronization/lock_unittest.cc +++ b/base/synchronization/lock_unittest.cc @@ -51,7 +51,7 @@ class BasicLockTestThread : public PlatformThread::Delegate { TEST(LockTest, Basic) { Lock lock; BasicLockTestThread thread(&lock); - PlatformThreadHandle handle = kNullThreadHandle; + PlatformThreadHandle handle; ASSERT_TRUE(PlatformThread::Create(0, &thread, &handle)); @@ -117,7 +117,7 @@ TEST(LockTest, TryLock) { // This thread will not be able to get the lock. { TryLockTestThread thread(&lock); - PlatformThreadHandle handle = kNullThreadHandle; + PlatformThreadHandle handle; ASSERT_TRUE(PlatformThread::Create(0, &thread, &handle)); @@ -131,7 +131,7 @@ TEST(LockTest, TryLock) { // This thread will.... { TryLockTestThread thread(&lock); - PlatformThreadHandle handle = kNullThreadHandle; + PlatformThreadHandle handle; ASSERT_TRUE(PlatformThread::Create(0, &thread, &handle)); @@ -178,7 +178,7 @@ TEST(LockTest, MutexTwoThreads) { int value = 0; MutexLockTestThread thread(&lock, &value); - PlatformThreadHandle handle = kNullThreadHandle; + PlatformThreadHandle handle; ASSERT_TRUE(PlatformThread::Create(0, &thread, &handle)); @@ -196,9 +196,9 @@ TEST(LockTest, MutexFourThreads) { MutexLockTestThread thread1(&lock, &value); MutexLockTestThread thread2(&lock, &value); MutexLockTestThread thread3(&lock, &value); - PlatformThreadHandle handle1 = kNullThreadHandle; - PlatformThreadHandle handle2 = kNullThreadHandle; - PlatformThreadHandle handle3 = kNullThreadHandle; + PlatformThreadHandle handle1; + PlatformThreadHandle handle2; + PlatformThreadHandle handle3; ASSERT_TRUE(PlatformThread::Create(0, &thread1, &handle1)); ASSERT_TRUE(PlatformThread::Create(0, &thread2, &handle2)); |