Skip to content

Commit c8a96e0

Browse files
zhengshuxinzhengshuxin
authored andcommitted
test wait_group.
1 parent a2104c3 commit c8a96e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/cxx/waite_group/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int main(int argc, char *argv[]) {
5858
sync.add(threads_count + fibers_count);
5959

6060
for (int i = 0; i < threads_count; i++) {
61-
std::thread* thr = new std::thread([&sync] {
61+
std::thread thr([&sync] {
6262
std::cout << "Thread " << std::this_thread::get_id()
6363
<< " started, delay " << __delay << " seconds\r\n";
6464

@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
6868
sync.done();
6969
});
7070

71-
thr->detach();
71+
thr.detach();
7272
}
7373

7474
for (int i = 0; i < fibers_count; i++) {

0 commit comments

Comments
 (0)