Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Result of not joining thread in main()
#include <chrono> #include <iostream> #include <thread> class active_object { public: active_object() : m_thread(&active_object::thread_body, this) {} private: void thread_body() { std::cout << "Thread body just started" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(200)); std::cout << "Thread body about to end" << std::endl; } std::thread m_thread; }; int main() { std::cout << "Started main, starting worker" << std::endl; active_object runner; std::cout << "Started worker" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); return 0; }
run
|
edit
|
history
|
help
0
user defined exception
problem_name_1
Math1
Throttle Example (Send two requests every two seconds)
10226
test string
general
Unqualified free functions
What's the problem with this?
test