~ci-train-bot/ubuntu-app-launch/ubuntu-app-launch-ubuntu-yakkety-landing-1944

« back to all changes in this revision

Viewing changes to libubuntu-app-launch/glib-thread.h

Migrate starting and stopping applications to new classes

Approved by: Charles Kerr, unity-api-1-bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#pragma once
21
21
 
22
22
#include <future>
 
23
#include <mutex>
23
24
#include <thread>
24
25
 
25
26
#include <gio/gio.h>
34
35
    std::shared_ptr<GMainLoop> _loop;
35
36
    std::shared_ptr<GCancellable> _cancel;
36
37
 
 
38
    std::function<void(void)> afterLoop_;
 
39
    std::shared_ptr<std::once_flag> afterFlag_;
 
40
 
37
41
public:
38
42
    ContextThread(std::function<void()> beforeLoop = [] {}, std::function<void()> afterLoop = [] {});
39
43
    ~ContextThread();