Mir
display_server.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by:
17  * Alan Griffiths <alan@octopull.co.uk>
18  * Thomas Voss <thomas.voss@canonical.com>
19  */
20 
21 #ifndef MIR_DISPLAY_SERVER_H_
22 #define MIR_DISPLAY_SERVER_H_
23 
24 #include <memory>
25 #include <atomic>
26 
28 namespace mir
29 {
30 class ServerConfiguration;
31 
33 {
34 public:
35  explicit DisplayServer(ServerConfiguration& config);
36 
38 
39  void run();
40  void stop();
41 
42 private:
43  struct Private;
44  // This gets dereferenced in stop(), called across thread boundaries,
45  // so gets (correctly, if harmlessly) detected as a data race if it's not atomic.
46  std::atomic<Private*> const p;
47 
48  DisplayServer() = delete;
49  DisplayServer(const DisplayServer&) = delete;
50  DisplayServer& operator=(const DisplayServer&) = delete;
51 };
52 
53 }
54 
55 #endif /* MIR_DISPLAY_SERVER_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: server_configuration.h:67
~DisplayServer()
Definition: display_server.cpp:198
void stop()
Definition: display_server.cpp:226
void run()
Definition: display_server.cpp:203
Definition: display_server.h:32

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016