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

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

Issue 637263002: Fix data races and leaks related to v8::Lockers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « src/v8threads.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 2007-2011 the V8 project authors. All rights reserved. 1 // Copyright 2007-2011 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 virtual ~JoinableThread() {} 136 virtual ~JoinableThread() {}
137 137
138 void Start() { 138 void Start() {
139 thread_.Start(); 139 thread_.Start();
140 } 140 }
141 141
142 void Join() { 142 void Join() {
143 semaphore_.Wait(); 143 semaphore_.Wait();
144 thread_.Join();
144 } 145 }
145 146
146 virtual void Run() = 0; 147 virtual void Run() = 0;
147 148
148 private: 149 private:
149 class ThreadWithSemaphore : public v8::base::Thread { 150 class ThreadWithSemaphore : public v8::base::Thread {
150 public: 151 public:
151 explicit ThreadWithSemaphore(JoinableThread* joinable_thread) 152 explicit ThreadWithSemaphore(JoinableThread* joinable_thread)
152 : Thread(Options(joinable_thread->name_)), 153 : Thread(Options(joinable_thread->name_)),
153 joinable_thread_(joinable_thread) {} 154 joinable_thread_(joinable_thread) {}
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 kSimpleExtensionSource)); 736 kSimpleExtensionSource));
736 const char* extension_names[] = { "test0", "test1", 737 const char* extension_names[] = { "test0", "test1",
737 "test2", "test3", "test4", 738 "test2", "test3", "test4",
738 "test5", "test6", "test7" }; 739 "test5", "test6", "test7" };
739 i::List<JoinableThread*> threads(kNThreads); 740 i::List<JoinableThread*> threads(kNThreads);
740 for (int i = 0; i < kNThreads; i++) { 741 for (int i = 0; i < kNThreads; i++) {
741 threads.Add(new IsolateGenesisThread(8, extension_names)); 742 threads.Add(new IsolateGenesisThread(8, extension_names));
742 } 743 }
743 StartJoinAndDeleteThreads(threads); 744 StartJoinAndDeleteThreads(threads);
744 } 745 }
OLDNEW
« no previous file with comments | « src/v8threads.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698