Skip to content

Commit

Permalink
Issue #43 - Job queue is no longer needed as a member in PTN_EngineIm…
Browse files Browse the repository at this point in the history
…p. Minor fixes.
  • Loading branch information
vldtecno committed May 20, 2024
1 parent c238c70 commit b7eddd3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PTN_Engine/Executor/JobQueueExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void JobQueueExecutor::executeAction(const ActionFunction &action, atomic<size_t
action();
--actionsInExecution;
};
m_jobQueue->addJob(f);
m_jobQueue.addJob(f);
}

} // namespace ptne
2 changes: 1 addition & 1 deletion PTN_Engine/Executor/JobQueueExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class JobQueueExecutor : public IActionsExecutor

private:
//! Job queue to dispatch actions.
std::unique_ptr<JobQueue> m_jobQueue = std::make_unique<JobQueue>();
JobQueue m_jobQueue;
};

} // namespace ptne
3 changes: 1 addition & 2 deletions PTN_Engine/PTN_EngineImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "PTN_Engine/PTN_EngineImp.h"
#include "PTN_Engine/Executor/ActionsExecutorFactory.h"
#include "PTN_Engine/JobQueue/JobQueue.h"
#include "PTN_Engine/Utilities/LockWeakPtr.h"
#include <algorithm>

Expand All @@ -31,8 +30,8 @@ using enum PTN_Engine::ACTIONS_THREAD_OPTION;

PTN_EngineImp::PTN_EngineImp(PTN_Engine::ACTIONS_THREAD_OPTION actionsThreadOption)
: m_actionsThreadOption(actionsThreadOption)
, m_eventLoop(*this)
, m_actionsExecutor(ActionsExecutorFactory::createExecutor(actionsThreadOption))
, m_eventLoop(*this)
{
}

Expand Down
3 changes: 0 additions & 3 deletions PTN_Engine/PTN_EngineImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ class PTN_EngineImp final : public IPTN_EngineEL
//! Loop that processes events and executes the Petri net.
EventLoop m_eventLoop;

//! Job queue to dispatch actions.
std::unique_ptr<JobQueue> m_jobQueue;

//! Flag reporting a new input event.
std::atomic<bool> m_newInputReceived = false;

Expand Down

0 comments on commit b7eddd3

Please sign in to comment.