OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_TOOLS_CRASH_SERVICE_CAPS_PROCESS_SINGLETON_WIN_H_ |
| 6 #define CHROME_TOOLS_CRASH_SERVICE_CAPS_PROCESS_SINGLETON_WIN_H_ |
| 7 |
| 8 #include <windows.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 |
| 12 namespace caps { |
| 13 // Uses a named mutex to make sure that only one process of |
| 14 // with this particular version is launched. |
| 15 class ProcessSingleton { |
| 16 public: |
| 17 ProcessSingleton(); |
| 18 ~ProcessSingleton(); |
| 19 bool other_instance() const { return mutex_ == NULL; } |
| 20 |
| 21 private: |
| 22 HANDLE mutex_; |
| 23 |
| 24 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); |
| 25 }; |
| 26 |
| 27 } // namespace caps |
| 28 |
| 29 #endif // CHROME_TOOLS_CRASH_SERVICE_CAPS_PROCESS_SINGLETON_WIN_H_ |
| 30 |
OLD | NEW |