diff options
Diffstat (limited to 'async/src/async.cpp')
-rw-r--r-- | async/src/async.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/async/src/async.cpp b/async/src/async.cpp index 0b8d7f3..e1d4806 100644 --- a/async/src/async.cpp +++ b/async/src/async.cpp | |||
@@ -48,51 +48,3 @@ JobBase::JobBase(Private::ExecutorBase *executor) | |||
48 | JobBase::~JobBase() | 48 | JobBase::~JobBase() |
49 | { | 49 | { |
50 | } | 50 | } |
51 | |||
52 | void JobBase::exec() | ||
53 | { | ||
54 | mExecutor->exec(); | ||
55 | } | ||
56 | |||
57 | |||
58 | FutureBase::FutureBase() | ||
59 | : mFinished(false) | ||
60 | , mWaitLoop(nullptr) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | FutureBase::FutureBase(const Async::FutureBase &other) | ||
65 | : mFinished(other.mFinished) | ||
66 | , mWaitLoop(other.mWaitLoop) | ||
67 | { | ||
68 | } | ||
69 | |||
70 | FutureBase::~FutureBase() | ||
71 | { | ||
72 | } | ||
73 | |||
74 | void FutureBase::setFinished() | ||
75 | { | ||
76 | mFinished = true; | ||
77 | if (mWaitLoop && mWaitLoop->isRunning()) { | ||
78 | mWaitLoop->quit(); | ||
79 | } | ||
80 | } | ||
81 | |||
82 | bool FutureBase::isFinished() const | ||
83 | { | ||
84 | return mFinished; | ||
85 | } | ||
86 | |||
87 | void FutureBase::waitForFinished() | ||
88 | { | ||
89 | if (mFinished) { | ||
90 | return; | ||
91 | } | ||
92 | |||
93 | mWaitLoop = new QEventLoop; | ||
94 | mWaitLoop->exec(QEventLoop::ExcludeUserInputEvents); | ||
95 | delete mWaitLoop; | ||
96 | mWaitLoop = 0; | ||
97 | } | ||
98 | |||