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

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

Issue 18509003: Keep two empty lines between declarations for cpp files (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-thread-termination.cc ('k') | test/cctest/test-types.cc » ('j') | 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 semaphore_->Signal(); 168 semaphore_->Signal();
169 } 169 }
170 170
171 private: 171 private:
172 i::List<i::ThreadId>* refs_; 172 i::List<i::ThreadId>* refs_;
173 int thread_no_; 173 int thread_no_;
174 i::Thread* thread_to_start_; 174 i::Thread* thread_to_start_;
175 i::Semaphore* semaphore_; 175 i::Semaphore* semaphore_;
176 }; 176 };
177 177
178
178 TEST(ThreadIdValidation) { 179 TEST(ThreadIdValidation) {
179 const int kNThreads = 100; 180 const int kNThreads = 100;
180 i::List<ThreadIdValidationThread*> threads(kNThreads); 181 i::List<ThreadIdValidationThread*> threads(kNThreads);
181 i::List<i::ThreadId> refs(kNThreads); 182 i::List<i::ThreadId> refs(kNThreads);
182 i::Semaphore* semaphore = i::OS::CreateSemaphore(0); 183 i::Semaphore* semaphore = i::OS::CreateSemaphore(0);
183 ThreadIdValidationThread* prev = NULL; 184 ThreadIdValidationThread* prev = NULL;
184 for (int i = kNThreads - 1; i >= 0; i--) { 185 for (int i = kNThreads - 1; i >= 0; i--) {
185 ThreadIdValidationThread* newThread = 186 ThreadIdValidationThread* newThread =
186 new ThreadIdValidationThread(prev, &refs, i, semaphore); 187 new ThreadIdValidationThread(prev, &refs, i, semaphore);
187 threads.Add(newThread); 188 threads.Add(newThread);
(...skipping 17 matching lines...) Expand all
205 Join(); 206 Join();
206 } 207 }
207 }; 208 };
208 209
209 210
210 TEST(ThreadJoinSelf) { 211 TEST(ThreadJoinSelf) {
211 ThreadC thread; 212 ThreadC thread;
212 thread.Start(); 213 thread.Start();
213 thread.Join(); 214 thread.Join();
214 } 215 }
OLDNEW
« no previous file with comments | « test/cctest/test-thread-termination.cc ('k') | test/cctest/test-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698