| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/process_util.h" | 5 #include "base/process_util.h" |
| 6 | 6 |
| 7 namespace base { | 7 namespace base { |
| 8 | 8 |
| 9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
| 10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} | 10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (executable_name_.size() > 15) { | 69 if (executable_name_.size() > 15) { |
| 70 executable_name_ = FilePath::StringType(executable_name_, | 70 executable_name_ = FilePath::StringType(executable_name_, |
| 71 executable_name_.size() - 15, 15); | 71 executable_name_.size() - 15, 15); |
| 72 } | 72 } |
| 73 #endif | 73 #endif |
| 74 } | 74 } |
| 75 | 75 |
| 76 NamedProcessIterator::~NamedProcessIterator() { | 76 NamedProcessIterator::~NamedProcessIterator() { |
| 77 } | 77 } |
| 78 | 78 |
| 79 #if defined(RENDERER_CLEAN_EXIT) |
| 80 base::subtle::Atomic32 exit_counter; |
| 81 |
| 82 extern void clean_exit(int return_value) |
| 83 { |
| 84 base::subtle::Atomic32 new_exit_counter; |
| 85 new_exit_counter = base::subtle:: |
| 86 Barrier_AtomicIncrement(&exit_counter, (base::subtle::Atomic32)1); |
| 87 if (new_exit_counter == 1) |
| 88 exit(return_value); |
| 89 else |
| 90 pthread_exit(NULL); |
| 91 } |
| 92 #endif // defined(RENDERER_CLEAN_EXIT) |
| 93 |
| 79 } // namespace base | 94 } // namespace base |
| OLD | NEW |