before formatting

This commit is contained in:
2022-12-14 13:56:19 +03:00
parent c74ba871cd
commit 430a41fefc
14 changed files with 912 additions and 623 deletions

View File

@@ -1,6 +1,6 @@
/*
PIP - Platform Independent Primitives
Stephan Fomenko
This program is free software: you can redistribute it and/or modify
@@ -21,6 +21,7 @@
#define PITHREADPOOLEXECUTOR_H
#include "piblockingqueue.h"
#include <atomic>
@@ -30,22 +31,18 @@ public:
virtual ~PIThreadPoolExecutor();
/**
* \brief Executes the given task sometime in the future. The task execute in an existing pooled thread. If the task
* cannot be submitted for execution, either because this executor has been shutdown or because its capacity has been
* reached.
*
* @param runnable not empty function for thread pool execution
*/
//! \brief Executes the given task sometime in the future. The task execute in an existing pooled thread. If the task
//! cannot be submitted for execution, either because this executor has been shutdown or because its capacity has been
//! reached.
//!
//! \param runnable not empty function for thread pool execution
void execute(const std::function<void()> & runnable);
void shutdownNow();
/**
* \brief Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be
* accepted. Invocation has no additional effect if already shut down. This method does not wait for previously
* submitted tasks to complete execution. Use awaitTermination to do that.
*/
//! \brief Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be
//! accepted. Invocation has no additional effect if already shut down. This method does not wait for previously
//! submitted tasks to complete execution. Use awaitTermination to do that.
void shutdown();
bool isShutdown() const;
@@ -54,8 +51,8 @@ public:
private:
std::atomic_bool isShutdown_;
PIBlockingQueue<std::function<void()> > taskQueue;
PIVector<PIThread*> threadPool;
PIBlockingQueue<std::function<void()>> taskQueue;
PIVector<PIThread *> threadPool;
};
#endif // PITHREADPOOLEXECUTOR_H