summaryrefslogtreecommitdiffstats
path: root/Source/cmWorkerPool.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Autogen: Redo locking and state machine for fence handling and the worker poolJoerg Sonnenberger2020-05-211-28/+41
| | | | | | | | | | | | | | | (1) All CV use must hold the corresponding mutex, otherwise race conditions happen. This is mandated by the C++ standard. (2) Introduce a separate CV for the thread waiting for other jobs to finish before running a fence. This avoids waking up all other workers blindly. Correctly wake that thread up when the processing of outstanding jobs is done. (3) Split the waiting for a fence to become runnable from a fence is pending. This avoids problems if more than one fence can end up on the queue. The thread that took a fence off the queue is responsible for clearing the fence processing flag.
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-1/+1
| | | | Fixes: #20666
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-6/+7
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-3/+3
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-0/+2
|
* cmWorkerPool: Factor our worker thread class (internals)Sebastian Holtermann2019-04-241-120/+106
| | | | | | This moves the `cmWorkerPoolInternal::WorkerT` class to `cmWorkerPoolWorker` and changes the thread start interface to make it independent of the `cmWorkerPoolInternal` type.
* cmWorkerPool: Set worker thread count separately to Process()Sebastian Holtermann2019-04-241-15/+22
| | | | | | | Don't pass the desired worker thread count to the `cmWorkerPool::Process()` method but set it separately with the new `cmWorkerPool::SetThreadCount` method. This allows calling `cmWorkerPool::Process()` repeatedly without having to pass the thread count every time.
* Autogen: Factor out concurrency framework to cmWorkerPool classSebastian Holtermann2019-04-151-0/+770
This factors out the concurrency framework in `cmQtAutoGeneratorMocUic` to a dedicated class `cmWorkerPool` which might be reused in other places. `cmWorkerPool` supports fence jobs that require that - all other jobs before in the queue have been processed before the fence job processing gets started, - no jobs later in the queue will be processed before the fence job processing has been completed. Fence jobs are needed where the completion of all previous jobs in the queue is a requirement for further processing. E.g. in `cmQtAutoGeneratorMocUic` the generation of `mocs_compilation.cpp` requires that all previous source file parse jobs have been completed.