Skip to content

Conversation

@Grufoony
Copy link
Collaborator

No description provided.

}
for (auto& thread : threads) {
thread.join();
for (const auto& [itineraryId, pItinerary] : m_itineraries) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
for (auto& thread : threads) {
thread.join();
for (const auto& [itineraryId, pItinerary] : m_itineraries) {
m_pool.enqueue([this, &pItinerary] { this->m_updatePath(pItinerary); });

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
#include <stdexcept>

namespace dsm {
ThreadPool::ThreadPool(const unsigned int nThreads) : m_stop(false), m_nActiveTasks{0} {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
m_cv.wait(lock, [this]() { return m_stop || !m_tasks.empty(); });

if (m_stop && m_tasks.empty()) {
return;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
{
std::unique_lock<std::mutex> lock(m_mutex);
++m_nActiveTasks;
m_tasks.emplace(std::move(task));

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 17.7 rule Note

MISRA 17.7 rule

void ThreadPool::waitAll() {
std::unique_lock<std::mutex> lock(m_mutex);
m_cv.wait(lock, [this]() { return m_nActiveTasks == 0; });

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
std::condition_variable m_cv;

public:
ThreadPool(const unsigned int nThreads = std::thread::hardware_concurrency());

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 13.4 rule Note

MISRA 13.4 rule
std::condition_variable m_cv;

public:
ThreadPool(const unsigned int nThreads = std::thread::hardware_concurrency());

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 17.8 rule Note

MISRA 17.8 rule
m_time{0},
m_previousSpireTime{0},
m_generator{std::random_device{}()} {
m_generator{std::random_device{}()},

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
@sbaldu sbaldu closed this Dec 18, 2024
@Grufoony Grufoony deleted the feature_ThreadPool branch March 25, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants