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

Unified Diff: base/process_util.cc

Issue 9837053: Added code for renderer to cleanly exit. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed some comments. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util.h ('k') | chrome/renderer/chrome_render_process_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util.cc
diff --git a/base/process_util.cc b/base/process_util.cc
index 9979dfa07b1b06ee9d8aca814da04907200f077d..0d578fb70b5aea99db52dbb4b39a88db1d664e6a 100644
--- a/base/process_util.cc
+++ b/base/process_util.cc
@@ -76,4 +76,19 @@ NamedProcessIterator::NamedProcessIterator(
NamedProcessIterator::~NamedProcessIterator() {
}
+#if defined(RENDERER_CLEAN_EXIT)
+base::subtle::Atomic32 exit_counter;
+
+extern void clean_exit(int return_value)
+{
+ base::subtle::Atomic32 new_exit_counter;
+ new_exit_counter = base::subtle::
+ Barrier_AtomicIncrement(&exit_counter, (base::subtle::Atomic32)1);
+ if (new_exit_counter == 1)
+ exit(return_value);
+ else
+ pthread_exit(NULL);
+}
+#endif // defined(RENDERER_CLEAN_EXIT)
+
} // namespace base
« no previous file with comments | « base/process_util.h ('k') | chrome/renderer/chrome_render_process_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698