diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-18 00:11:47 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-18 00:11:47 +0500 |
| commit | 3860b8e666347af2958abbdbd35d888fa94d1c07 (patch) | |
| tree | 9107cd22ee42797d6ffd275df1e0da4a9c206315 /src/main.cpp | |
| parent | bc7c6acaa4c35b89b406b89bc68b948f52bbe387 (diff) | |
FIX: FINALLY SOLVED THE THREAD PROBLEM!!! YIPEE
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 88b56cd..3c8f5e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -114,10 +114,14 @@ int main(int argc, char *argv[]) { client.run(); - std::thread timer_thread(bot::create_timer_thread, &client, &cfg); - timer_thread.join(); + std::vector<std::thread> threads; + threads.push_back(std::thread(bot::create_timer_thread, &client, &cfg)); + threads.push_back(std::thread(&bot::stream::StreamListenerClient::run, + &stream_listener_client)); - stream_listener_client.run_thread(); + for (auto &thread : threads) { + thread.join(); + } return 0; } |
