9#include "executewrapper_p.h"
13ExecuteWrapper::ExecuteWrapper()
17ExecuteWrapper::~ExecuteWrapper()
19 auto wrapped = this->wrapped.loadAcquire();
20 if (wrapped && wrapped->ownedByJob())
24Executor *ExecuteWrapper::wrap(Executor *previous)
26 return wrapped.fetchAndStoreOrdered(previous);
29Executor *ExecuteWrapper::unwrap(JobInterface *job)
31 Executor *executor = job->setExecutor(wrapped.fetchAndStoreOrdered(
nullptr));
32 Q_ASSERT_X(executor ==
this, Q_FUNC_INFO,
"ExecuteWrapper can only unwrap itself!");
36void ExecuteWrapper::begin(
const JobPointer &job, Thread *thread)
38 Q_ASSERT(wrapped.loadAcquire() !=
nullptr);
39 wrapped.loadAcquire()->begin(job, thread);
42void ExecuteWrapper::execute(
const JobPointer &job, Thread *thread)
44 executeWrapped(job, thread);
47void ExecuteWrapper::executeWrapped(
const JobPointer &job, Thread *thread)
49 Executor *executor = wrapped.loadAcquire();
50 Q_ASSERT_X(executor !=
nullptr, Q_FUNC_INFO,
"Wrapped Executor cannot be zero!");
51 executor->execute(job, thread);
54void ExecuteWrapper::end(
const JobPointer &job, Thread *thread)
56 Q_ASSERT(wrapped.loadAcquire() !=
nullptr);
57 wrapped.loadAcquire()->end(job, thread);
62#include "executewrapper_p.h"
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:38 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.