mirror of
https://github.com/upa/mscp.git
synced 2026-02-04 03:24:58 +08:00
spawn monitor thread before copy threads
This commit is contained in:
17
src/main.c
17
src/main.c
@@ -300,6 +300,14 @@ int main(int argc, char **argv)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* spawn count thread */
|
||||
ret = pthread_create(&mtid, NULL, sscp_monitor_thread, &sscp);
|
||||
if (ret < 0) {
|
||||
pr_err("pthread_create error: %d\n", ret);
|
||||
stop_all(0);
|
||||
goto join_out;
|
||||
}
|
||||
|
||||
/* spawn threads */
|
||||
threads = calloc(nr_threads, sizeof(struct sscp_thread));
|
||||
memset(threads, 0, nr_threads * sizeof(struct sscp_thread));
|
||||
@@ -319,15 +327,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* spawn count thread */
|
||||
ret = pthread_create(&mtid, NULL, sscp_monitor_thread, &sscp);
|
||||
if (ret < 0) {
|
||||
pr_err("pthread_create error: %d\n", ret);
|
||||
stop_all(0);
|
||||
goto join_out;
|
||||
}
|
||||
|
||||
|
||||
join_out:
|
||||
/* waiting for threads join... */
|
||||
for (n = 0; n < nr_threads; n++)
|
||||
|
||||
Reference in New Issue
Block a user