~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

Viewing changes to src/server/compositor/multi_threaded_compositor.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Alberto Aguirre
  • Date: 2014-09-09 18:28:01 UTC
  • mfrom: (1.1.74)
  • Revision ID: package-import@ubuntu.com-20140909182801-8ecmd3a5mpj21e8j
Tags: 0.7.1+14.10.20140909.1-0ubuntu1
[ Alberto Aguirre ]
* New upstream release 0.7.1 (https://launchpad.net/mir/+milestone/0.7.1)
  - Bug fixes
    . Recycle compositor threads by using a thread pool (LP: #1362841) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#define MIR_COMPOSITOR_MULTI_THREADED_COMPOSITOR_H_
21
21
 
22
22
#include "mir/compositor/compositor.h"
 
23
#include "mir/thread/basic_thread_pool.h"
23
24
 
24
25
#include <mutex>
25
26
#include <memory>
26
27
#include <vector>
27
 
#include <thread>
 
28
#include <future>
28
29
 
29
30
namespace mir
30
31
{
76
77
    std::shared_ptr<CompositorReport> const report;
77
78
 
78
79
    std::vector<std::unique_ptr<CompositingFunctor>> thread_functors;
79
 
    std::vector<std::thread> threads;
 
80
    std::vector<std::future<void>> futures;
80
81
 
81
82
    std::mutex state_guard;
82
83
    CompositorState state;
83
84
    bool compose_on_start;
84
85
 
85
86
    void schedule_compositing(int number_composites);
86
 
    
 
87
 
87
88
    std::shared_ptr<mir::scene::Observer> observer;
 
89
    mir::thread::BasicThreadPool thread_pool;
88
90
};
89
91
 
90
92
}