]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Initialization/SystemLifetimeManager.h
Update to bmake-201802222
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Initialization / SystemLifetimeManager.h
1 //===-- SystemLifetimeManager.h -------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLDB_INITIALIZATION_SYSTEM_LIFETIME_MANAGER_H
11 #define LLDB_INITIALIZATION_SYSTEM_LIFETIME_MANAGER_H
12
13 #include "lldb/lldb-private-types.h"
14
15 #include <memory>
16 #include <mutex>
17
18 namespace lldb_private {
19 class SystemInitializer;
20
21 class SystemLifetimeManager {
22 public:
23   SystemLifetimeManager();
24   ~SystemLifetimeManager();
25
26   void Initialize(std::unique_ptr<SystemInitializer> initializer,
27                   LoadPluginCallbackType plugin_callback);
28   void Terminate();
29
30 private:
31   std::recursive_mutex m_mutex;
32   std::unique_ptr<SystemInitializer> m_initializer;
33   bool m_initialized;
34
35   // Noncopyable.
36   SystemLifetimeManager(const SystemLifetimeManager &other) = delete;
37   SystemLifetimeManager &operator=(const SystemLifetimeManager &other) = delete;
38 };
39 }
40
41 #endif