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

Side by Side Diff: Source/web/WebKit.cpp

Issue 670683002: Terminate worker threads before detaching main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « Source/core/Init.cpp ('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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 ASSERT(s_messageLoopInterruptor); 202 ASSERT(s_messageLoopInterruptor);
203 ThreadState::current()->removeInterruptor(s_messageLoopInterruptor); 203 ThreadState::current()->removeInterruptor(s_messageLoopInterruptor);
204 delete s_messageLoopInterruptor; 204 delete s_messageLoopInterruptor;
205 s_messageLoopInterruptor = 0; 205 s_messageLoopInterruptor = 0;
206 } 206 }
207 207
208 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); 208 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate();
209 V8PerIsolateData::willBeDestroyed(isolate); 209 V8PerIsolateData::willBeDestroyed(isolate);
210 210
211 // Make sure we stop WorkerThreads before the main thread's ThreadState
212 // and later shutdown steps starts freeing up resources needed during
213 // worker termination.
214 WorkerThread::terminateAndWaitForAllWorkers();
215
211 // Detach the main thread before starting the shutdown sequence 216 // Detach the main thread before starting the shutdown sequence
212 // so that the main thread won't get involved in a GC during the shutdown. 217 // so that the main thread won't get involved in a GC during the shutdown.
213 ThreadState::detachMainThread(); 218 ThreadState::detachMainThread();
214 219
215 V8PerIsolateData::destroy(isolate); 220 V8PerIsolateData::destroy(isolate);
216 221
217 shutdownWithoutV8(); 222 shutdownWithoutV8();
218 } 223 }
219 224
220 void shutdownWithoutV8() 225 void shutdownWithoutV8()
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 channel->state = WTFLogChannelOn; 261 channel->state = WTFLogChannelOn;
257 #endif // !LOG_DISABLED 262 #endif // !LOG_DISABLED
258 } 263 }
259 264
260 void resetPluginCache(bool reloadPages) 265 void resetPluginCache(bool reloadPages)
261 { 266 {
262 Page::refreshPlugins(reloadPages); 267 Page::refreshPlugins(reloadPages);
263 } 268 }
264 269
265 } // namespace blink 270 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/Init.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698