| 1821 | pthread_mutex_unlock(&g_pool.mutex); |
| 1822 | |
| 1823 | const uint64_t rows_per_thread = (n_rows + n_threads - 1) / n_threads; |
| 1824 | const uint64_t row0 = (uint64_t)tid * rows_per_thread; |
| 1825 | uint64_t row1 = row0 + rows_per_thread; |
| 1826 | if (row1 > n_rows) row1 = n_rows; |
| 1827 | if (row0 < row1) { |
| 1828 | g_parallel_depth++; |
| 1829 | fn(ctx, row0, row1); |
| 1830 | g_parallel_depth--; |
| 1831 | } |
| 1832 | |
| 1833 | pthread_mutex_lock(&g_pool.mutex); |
| 1834 | g_pool.done++; |
no outgoing calls
no test coverage detected