aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/local_executor/local_executor.h
diff options
context:
space:
mode:
authorStanislav Kirillov <staskirillov@gmail.com>2022-02-10 16:46:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:07 +0300
commit92fe2b1e7bc79f7b95adef61714fc003f6ea4a1c (patch)
tree817034f4ca57c9f841bb047ec94630c2e78a2b1d /library/cpp/threading/local_executor/local_executor.h
parent53c76da6d9f6cc5a17f6029df396f0e3bc1ff47d (diff)
downloadydb-92fe2b1e7bc79f7b95adef61714fc003f6ea4a1c.tar.gz
Restoring authorship annotation for Stanislav Kirillov <staskirillov@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/local_executor/local_executor.h')
-rw-r--r--library/cpp/threading/local_executor/local_executor.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/threading/local_executor/local_executor.h b/library/cpp/threading/local_executor/local_executor.h
index c1c824f67c..e12536bd46 100644
--- a/library/cpp/threading/local_executor/local_executor.h
+++ b/library/cpp/threading/local_executor/local_executor.h
@@ -11,15 +11,15 @@
#include <functional>
-namespace NPar {
- struct ILocallyExecutable : virtual public TThrRefBase {
+namespace NPar {
+ struct ILocallyExecutable : virtual public TThrRefBase {
// Must be implemented by the end user to define job that will be processed by one of
// executor threads.
//
// @param id Job parameter, typically an index pointing somewhere in array, or just
// some dummy value, e.g. `0`.
- virtual void LocalExec(int id) = 0;
- };
+ virtual void LocalExec(int id) = 0;
+ };
// Alternative and simpler way of describing a job for executor. Function argument has the
// same meaning as `id` in `ILocallyExecutable::LocalExec`.
@@ -27,17 +27,17 @@ namespace NPar {
using TLocallyExecutableFunction = std::function<void(int)>;
class ILocalExecutor: public TNonCopyable {
- public:
+ public:
ILocalExecutor() = default;
virtual ~ILocalExecutor() = default;
enum EFlags : int {
- HIGH_PRIORITY = 0,
- MED_PRIORITY = 1,
- LOW_PRIORITY = 2,
- PRIORITY_MASK = 3,
- WAIT_COMPLETE = 4
- };
+ HIGH_PRIORITY = 0,
+ MED_PRIORITY = 1,
+ LOW_PRIORITY = 2,
+ PRIORITY_MASK = 3,
+ WAIT_COMPLETE = 4
+ };
// Add task for further execution.
//
@@ -156,7 +156,7 @@ namespace NPar {
}
ExecRange(BlockedLoopBody(params, body), 0, params.GetBlockCount(), flags);
}
-
+
template <typename TBody>
inline void ExecRangeBlockedWithThrow(TBody&& body, int firstId, int lastId, int batchSizeOrZeroForAutoBatchSize, int flags) {
if (firstId >= lastId) {
@@ -270,8 +270,8 @@ namespace NPar {
};
static inline TLocalExecutor& LocalExecutor() {
- return *Singleton<TLocalExecutor>();
- }
+ return *Singleton<TLocalExecutor>();
+ }
template <typename TBody>
inline void ParallelFor(ILocalExecutor& executor, ui32 from, ui32 to, TBody&& body) {