Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor System_launchParallelTasks. (#8762)
- Remove variable size arrays. Even for gcc/clang. - Make sure the pthread_attr_t we careate on Windows MinGW is destroyed. Otherwise we are possibly leaking memory. Maybe it is better to create a `pthread attribute` on all systems even if we do not need to modify any attributes. It avoids the CPP checks and makes it a bit more readable. - Expect to join exactly as many threads as we managed to create. Not as many as we intended to create. We can fail to create the `i`th thread out of `numThreads` threads we intended to create. - Simplify code for setting stack size by using short circute evaluation. We should probably generalize the ´setting stack size´ to Windows (_WIN32) from just MinGW (_MINGW32_). - Use the message we read from error no (`strerror`) in our messages. If this was not the intention for some reason, then the calls to `strerror` should be removed completely.
- Loading branch information
Showing
1 changed file
with
35 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters