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

Side by Side Diff: test/cctest/test-platform-tls.cc

Issue 7003108: "Deiceolate" Thread classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // 2 //
3 // Tests of fast TLS support. 3 // Tests of fast TLS support.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "cctest.h" 7 #include "cctest.h"
8 #include "checks.h" 8 #include "checks.h"
9 #include "platform.h" 9 #include "platform.h"
10 10
(...skipping 30 matching lines...) Expand all
41 for (int i = 0; i < kValueCount; i++) { 41 for (int i = 0; i < kValueCount; i++) {
42 CHECK_EQ(GetValue(kValueCount - i - 1), 42 CHECK_EQ(GetValue(kValueCount - i - 1),
43 Thread::GetThreadLocal(keys[i])); 43 Thread::GetThreadLocal(keys[i]));
44 CHECK_EQ(GetValue(kValueCount - i - 1), 44 CHECK_EQ(GetValue(kValueCount - i - 1),
45 Thread::GetExistingThreadLocal(keys[i])); 45 Thread::GetExistingThreadLocal(keys[i]));
46 } 46 }
47 } 47 }
48 48
49 class TestThread : public Thread { 49 class TestThread : public Thread {
50 public: 50 public:
51 TestThread() : Thread(NULL, "TestThread") {} 51 TestThread() : Thread("TestThread") {}
52 52
53 virtual void Run() { 53 virtual void Run() {
54 DoTest(); 54 DoTest();
55 } 55 }
56 }; 56 };
57 57
58 TEST(FastTLS) { 58 TEST(FastTLS) {
59 for (int i = 0; i < kValueCount; i++) { 59 for (int i = 0; i < kValueCount; i++) {
60 keys[i] = Thread::CreateThreadLocalKey(); 60 keys[i] = Thread::CreateThreadLocalKey();
61 } 61 }
62 DoTest(); 62 DoTest();
63 TestThread thread; 63 TestThread thread;
64 thread.Start(); 64 thread.Start();
65 thread.Join(); 65 thread.Join();
66 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698