From c7e36ad184653a1edf5d39d81124e7a51bcb7121 Mon Sep 17 00:00:00 2001 From: hcj116 Date: Fri, 20 Oct 2023 10:21:01 +0800 Subject: [PATCH 1/2] Update 01-thread.MD update crypt --- 01-thread.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-thread.MD b/01-thread.MD index 0dfa469..5e47f9b 100644 --- a/01-thread.MD +++ b/01-thread.MD @@ -102,7 +102,7 @@ b = a; ```c++ thread& operator=(thread&& a); ``` -赋完值后,原来由a管理的线程改为由b管理,b不再指向任何线程(相当于执行了detach操作)。如果b原本指向了一个线程,那么这个线程会被终止掉。 +赋完值后,原来由a管理的线程改为由b管理,a不再指向任何线程(相当于执行了detach操作)。如果b原本指向了一个线程,那么这个线程会被终止掉。 ### 2. detach/joinable detach是std::thread的成员函数,函数原型为: ```c++ From 75621c07ef21f21ce1600a8a895dfd0987f4a1f9 Mon Sep 17 00:00:00 2001 From: hcj116 Date: Fri, 20 Oct 2023 10:25:27 +0800 Subject: [PATCH 2/2] Update 01-thread.MD --- 01-thread.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-thread.MD b/01-thread.MD index 5e47f9b..38f4bb0 100644 --- a/01-thread.MD +++ b/01-thread.MD @@ -1,6 +1,6 @@ # C++11多线程(简约但不简单) ## 一、简单使用 -C++11提供了一套精练的线程库,小巧且易用。运行一个线程,可以直接创建一个std::thread的实例,线程在实例成功构造成时启动。若有底层平台支持,成员函数std::thread::native_handle()将可提供对原生线程对象运行平台特定的操作。 +C++11提供了一套精练的线程库,小巧且易用。运行一个线程,可以直接创建一个std::thread的实例,线程在实例成功构造成时启动。若有底层平台支持,成员函数std::thread ::native_handle()将可提供对原生线程对象运行平台特定的操作。 ```c++ #include #include