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

Side by Side Diff: test/cctest/test-threads.cc

Issue 1116853002: [base] Drop obsolete Thread::YieldCPU. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Of course also remove it from the cctest Created 5 years, 7 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
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 " var result = \"a\".search(\"a\");" 63 " var result = \"a\".search(\"a\");"
64 " if (result != 0) throw \"result: \" + result + \" @\" + i;" 64 " if (result != 0) throw \"result: \" + result + \" @\" + i;"
65 "};" 65 "};"
66 "true")); 66 "true"));
67 CHECK(script->Run()->IsTrue()); 67 CHECK(script->Run()->IsTrue());
68 68
69 turn = CLEAN_CACHE; 69 turn = CLEAN_CACHE;
70 do { 70 do {
71 { 71 {
72 v8::Unlocker unlocker(CcTest::isolate()); 72 v8::Unlocker unlocker(CcTest::isolate());
73 Thread::YieldCPU();
74 } 73 }
75 } while (turn != SECOND_TIME_FILL_CACHE); 74 } while (turn != SECOND_TIME_FILL_CACHE);
76 75
77 // Rerun the script. 76 // Rerun the script.
78 CHECK(script->Run()->IsTrue()); 77 CHECK(script->Run()->IsTrue());
79 78
80 turn = DONE; 79 turn = DONE;
81 } 80 }
82 }; 81 };
83 82
(...skipping 11 matching lines...) Expand all
95 v8::HandleScope scope(isolate); 94 v8::HandleScope scope(isolate);
96 v8::Handle<v8::Context> context = v8::Context::New(isolate); 95 v8::Handle<v8::Context> context = v8::Context::New(isolate);
97 v8::Context::Scope context_scope(context); 96 v8::Context::Scope context_scope(context);
98 97
99 // Clear the caches by forcing major GC. 98 // Clear the caches by forcing major GC.
100 CcTest::heap()->CollectAllGarbage(); 99 CcTest::heap()->CollectAllGarbage();
101 turn = SECOND_TIME_FILL_CACHE; 100 turn = SECOND_TIME_FILL_CACHE;
102 break; 101 break;
103 } 102 }
104 } 103 }
105
106 Thread::YieldCPU();
107 } while (true); 104 } while (true);
108 } 105 }
109 }; 106 };
110 107
111 108
112 TEST(JSFunctionResultCachesInTwoThreads) { 109 TEST(JSFunctionResultCachesInTwoThreads) {
113 ThreadA threadA; 110 ThreadA threadA;
114 ThreadB threadB; 111 ThreadB threadB;
115 112
116 threadA.Start(); 113 threadA.Start();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 refs.Add(i::ThreadId::Invalid()); 165 refs.Add(i::ThreadId::Invalid());
169 } 166 }
170 prev->Start(); 167 prev->Start();
171 for (int i = 0; i < kNThreads; i++) { 168 for (int i = 0; i < kNThreads; i++) {
172 semaphore.Wait(); 169 semaphore.Wait();
173 } 170 }
174 for (int i = 0; i < kNThreads; i++) { 171 for (int i = 0; i < kNThreads; i++) {
175 delete threads[i]; 172 delete threads[i];
176 } 173 }
177 } 174 }
OLDNEW
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698