We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2104c3 commit c8a96e0Copy full SHA for c8a96e0
samples/cxx/waite_group/main.cpp
@@ -58,7 +58,7 @@ int main(int argc, char *argv[]) {
58
sync.add(threads_count + fibers_count);
59
60
for (int i = 0; i < threads_count; i++) {
61
- std::thread* thr = new std::thread([&sync] {
+ std::thread thr([&sync] {
62
std::cout << "Thread " << std::this_thread::get_id()
63
<< " started, delay " << __delay << " seconds\r\n";
64
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
68
sync.done();
69
});
70
71
- thr->detach();
+ thr.detach();
72
}
73
74
for (int i = 0; i < fibers_count; i++) {
0 commit comments