]> git.tdb.fi Git - builder.git/blob - source/internaltask.cpp
Save caches before starting the build
[builder.git] / source / internaltask.cpp
1 #include "internaltask.h"
2
3 InternalTask::InternalTask(Worker *w):
4         worker(w)
5 { }
6
7 InternalTask::~InternalTask()
8 {
9         worker->join();
10         delete worker;
11 }
12
13 void InternalTask::start()
14 {
15         prepare();
16         worker->launch();
17 }
18
19 Task::Status InternalTask::check()
20 {
21         Status result = worker->get_status();
22         if(result!=RUNNING)
23                 signal_finished.emit(result==SUCCESS);
24         return result;
25 }
26
27 Task::Status InternalTask::wait()
28 {
29         Status result;
30         while((result = check())==RUNNING) ;
31         return result;
32 }
33
34
35 InternalTask::Worker::Worker():
36         status(Task::RUNNING)
37 { }