diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:44 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:44 +0900 |
commit | 99a800848c2512f7c93504fc7b28e6182a6ceb93 (patch) | |
tree | 0236502664965e5284d0c950ed2c1bf294b1233b /Source/cmWorkerPool.h | |
parent | df4ed7977a77409f899f6f05389960f6b73125a8 (diff) | |
download | cmake-99a800848c2512f7c93504fc7b28e6182a6ceb93.tar.gz cmake-99a800848c2512f7c93504fc7b28e6182a6ceb93.tar.bz2 cmake-99a800848c2512f7c93504fc7b28e6182a6ceb93.zip |
Imported Upstream version 3.20.0upstream/3.20.0
Diffstat (limited to 'Source/cmWorkerPool.h')
-rw-r--r-- | Source/cmWorkerPool.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h index 0fb670724..ff255261d 100644 --- a/Source/cmWorkerPool.h +++ b/Source/cmWorkerPool.h @@ -28,7 +28,8 @@ public: void reset(); bool error() const { - return (ExitStatus != 0) || (TermSignal != 0) || !ErrorMessage.empty(); + return (this->ExitStatus != 0) || (this->TermSignal != 0) || + !this->ErrorMessage.empty(); } std::int64_t ExitStatus = 0; @@ -60,7 +61,7 @@ public: * - no jobs later in the queue will be processed before this job was * processed */ - bool IsFence() const { return Fence_; } + bool IsFence() const { return this->Fence_; } protected: /** @@ -80,13 +81,13 @@ public: * Get the worker pool. * Only valid during the JobT::Process() call! */ - cmWorkerPool* Pool() const { return Pool_; } + cmWorkerPool* Pool() const { return this->Pool_; } /** * Get the user data. * Only valid during the JobT::Process() call! */ - void* UserData() const { return Pool_->UserData(); }; + void* UserData() const { return this->Pool_->UserData(); }; /** * Get the worker index. @@ -95,7 +96,7 @@ public: * Concurrently processing jobs will never have the same WorkerIndex(). * Only valid during the JobT::Process() call! */ - unsigned int WorkerIndex() const { return WorkerIndex_; } + unsigned int WorkerIndex() const { return this->WorkerIndex_; } /** * Run an external read only process. @@ -111,12 +112,11 @@ public: //! Worker thread entry method. void Work(cmWorkerPool* pool, unsigned int workerIndex) { - Pool_ = pool; - WorkerIndex_ = workerIndex; + this->Pool_ = pool; + this->WorkerIndex_ = workerIndex; this->Process(); } - private: cmWorkerPool* Pool_ = nullptr; unsigned int WorkerIndex_ = 0; bool Fence_ = false; @@ -150,10 +150,9 @@ public: { public: //! Does nothing - void Process() override { Pool()->Abort(); } + void Process() override { this->Pool()->Abort(); } }; -public: // -- Methods cmWorkerPool(); ~cmWorkerPool(); @@ -161,7 +160,7 @@ public: /** * Number of worker threads. */ - unsigned int ThreadCount() const { return ThreadCount_; } + unsigned int ThreadCount() const { return this->ThreadCount_; } /** * Set the number of worker threads. @@ -184,7 +183,7 @@ public: * * Only valid during Process(). */ - void* UserData() const { return UserData_; } + void* UserData() const { return this->UserData_; } // -- Job processing interface @@ -212,7 +211,7 @@ public: template <class T, typename... Args> bool EmplaceJob(Args&&... args) { - return PushJob(cm::make_unique<T>(std::forward<Args>(args)...)); + return this->PushJob(cm::make_unique<T>(std::forward<Args>(args)...)); } private: |