There was an error while loading. Please reload this page.
1 parent dcc3dd4 commit bbd5e76Copy full SHA for bbd5e76
src/2-SmartPointer/shared_pointer.cpp
@@ -94,7 +94,7 @@ namespace sharedpointer {
94
<< "thread: [" << std::this_thread::get_id()
95
<< "] use count for shared_ptr<Number>: "
96
<< shared_num.use_count() << "\n";
97
- std::this_thread::sleep_for(300ms);
+ std::this_thread::sleep_for(1s);
98
}
99
std::cout << "thread will end here.. use count: " << num.use_count() << "\n";
100
@@ -105,7 +105,7 @@ namespace sharedpointer {
105
auto sharedNumber = std::make_shared<Number>(10);
106
waiter = std::async(launch::async, second_thread_func_weak,
107
std::weak_ptr<Number>(sharedNumber));
108
- std::this_thread::sleep_for(2s);
+ std::this_thread::sleep_for(200ms);
109
110
waiter.wait();
111
0 commit comments