summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2022-10-23 16:05:49 +0900
committerRyo Nakamura <upa@haeena.net>2022-10-23 16:05:49 +0900
commit03a20c77d8abf86616cef9e7671b80cfcce42a2f (patch)
treea0d50b9befa5576d9e92ee278f4027029cf3a51f /src/main.c
parent77e977ce8e6ff78dced24f9c8a253a1b6d53115d (diff)
spawn monitor thread before copy threads
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index a8d7114..79d6622 100644
--- a/src/main.c
+++ b/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++)