Skip to content

Commit c503d69

Browse files
mkopcinsMateusz Kopciński
andcommitted
bug: fix to a bug where sometimes threadpool could be configured to 0 workers (#673)
## Description <!-- Provide a concise and descriptive summary of the changes implemented in this PR. --> ### Introduces a breaking change? - [ ] Yes - [ ] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions <!-- Provide step-by-step instructions on how to test your changes. Include setup details if necessary. --> ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. --> Co-authored-by: Mateusz Kopciński <[email protected]>
1 parent 030918c commit c503d69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native-executorch/common/rnexecutorch/threads/HighPerformanceThreadPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class HighPerformanceThreadPool {
4747

4848
#ifdef __ANDROID__
4949
detectCPUTopology();
50-
numThreads = std::min(numThreads, performanceCores.size());
50+
numThreads = std::max(std::min(numThreads, performanceCores.size()), 2lu);
5151
#endif
5252

5353
for (size_t i = 0; i < numThreads; i++) {

0 commit comments

Comments
 (0)