]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/Initialization/SystemLifetimeManager.h
Vendor import of lldb release_39 branch r276489:
[FreeBSD/FreeBSD.git] / 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 {
20 class SystemInitializer;
21
22 class SystemLifetimeManager
23 {
24   public:
25     SystemLifetimeManager();
26     ~SystemLifetimeManager();
27
28     void Initialize(std::unique_ptr<SystemInitializer> initializer, LoadPluginCallbackType plugin_callback);
29     void Terminate();
30
31   private:
32       std::recursive_mutex m_mutex;
33       std::unique_ptr<SystemInitializer> m_initializer;
34       bool m_initialized;
35
36       // Noncopyable.
37       SystemLifetimeManager(const SystemLifetimeManager &other) = delete;
38       SystemLifetimeManager &
39       operator=(const SystemLifetimeManager &other) = delete;
40 };
41 }
42
43 #endif