ThreadWeaver
9 #include "executewrapper_p.h"
11 namespace ThreadWeaver
13 ExecuteWrapper::ExecuteWrapper()
17 Executor *ExecuteWrapper::wrap(Executor *previous)
19 return wrapped.fetchAndStoreOrdered(previous);
22 Executor *ExecuteWrapper::unwrap(
const JobPointer &job)
24 Executor *executor = job->setExecutor(wrapped.fetchAndStoreOrdered(
nullptr));
25 Q_ASSERT_X(executor ==
this, Q_FUNC_INFO,
"ExecuteWrapper can only unwrap itself!");
29 void ExecuteWrapper::begin(
const JobPointer &job, Thread *thread)
31 Q_ASSERT(wrapped.loadAcquire() !=
nullptr);
32 wrapped.loadAcquire()->begin(job, thread);
35 void ExecuteWrapper::execute(
const JobPointer &job, Thread *thread)
37 executeWrapped(job, thread);
40 void ExecuteWrapper::executeWrapped(
const JobPointer &job, Thread *thread)
42 Executor *executor = wrapped.loadAcquire();
43 Q_ASSERT_X(executor !=
nullptr, Q_FUNC_INFO,
"Wrapped Executor cannot be zero!");
44 executor->execute(job, thread);
47 void ExecuteWrapper::end(
const JobPointer &job, Thread *thread)
49 Q_ASSERT(wrapped.loadAcquire() !=
nullptr);
50 wrapped.loadAcquire()->end(job, thread);
55 #include "executewrapper_p.h"
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:10:21 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.