summaryrefslogtreecommitdiff
path: root/src/mscp.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-03-15 22:19:09 +0900
committerRyo Nakamura <upa@haeena.net>2023-03-15 22:19:09 +0900
commitf5d0f526f21f0a8428906789af5898662216032d (patch)
tree91c468d90d682035aa083c4d059e22660b898c9b /src/mscp.c
parenta086e6a15499d20c4116a784cc68eb1c6b5a5eff (diff)
add comment to mscp_scan(), why usleep(100)
Diffstat (limited to 'src/mscp.c')
-rw-r--r--src/mscp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mscp.c b/src/mscp.c
index c99bcea..41a1418 100644
--- a/src/mscp.c
+++ b/src/mscp.c
@@ -449,8 +449,11 @@ int mscp_scan(struct mscp *m)
return -1;
}
- /* wait until preparation is end or over nr_threads chunks are
- * filled */
+ /* need scan finished or over nr_threads chunks to determine
+ * actual number of threads (and connections). If the number
+ * of chunks are smaller than nr_threads, we adjust nr_threads
+ * to the number of chunks.
+ */
while (!chunk_pool_is_filled(&m->cp) &&
chunk_pool_size(&m->cp) < m->opts->nr_threads)
usleep(100);