Index: base/process_util.cc |
diff --git a/base/process_util.cc b/base/process_util.cc |
index 9979dfa07b1b06ee9d8aca814da04907200f077d..4d401788d730372922beba264267ebe38bedda67 100644 |
--- a/base/process_util.cc |
+++ b/base/process_util.cc |
@@ -76,4 +76,25 @@ NamedProcessIterator::NamedProcessIterator( |
NamedProcessIterator::~NamedProcessIterator() { |
} |
+#if defined(RENDERER_CLEAN_EXIT) |
+base::subtle::Atomic32 exit_counter; |
+ |
+extern void clean_exit(int return_value) |
Markus (顧孟勤)
2012/03/28 23:07:56
This function should be marked as __attribute__((n
|
+{ |
+ base::subtle::Atomic32 new_exit_counter; |
+ new_exit_counter = base::subtle:: |
+ Barrier_AtomicIncrement(&exit_counter, (base::subtle::Atomic32)1); |
+ if (new_exit_counter == 1) |
+ { |
+ fprintf(stderr, "Renderer process exiting.\n"); |
Markus (顧孟勤)
2012/03/28 23:07:56
If you plan on calling clean_exit() from a signal
|
+ exit(return_value); |
+ } |
+ else |
+ { |
+ fprintf(stderr, "Another renderer thread already called exit!.\n"); |
+ fprintf(stderr, "Not calling exit() myself.\n"); |
Markus (顧孟勤)
2012/03/28 23:07:56
I don't think you ever want to return from this fu
|
+ } |
+} |
+#endif // defined(RENDERER_CLEAN_EXIT) |
+ |
} // namespace base |