From 601dcd8e0d8d07c2b6ec3fbe3a12df6d8adbc7af Mon Sep 17 00:00:00 2001 From: LiuMaoyang Date: Mon, 8 Jun 2015 15:33:55 +1200 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9yield=E7=9A=84?= =?UTF-8?q?=E8=A7=A3=E9=87=8A=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh/chapter3-Thread/Introduction-to-Thread.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh/chapter3-Thread/Introduction-to-Thread.md b/zh/chapter3-Thread/Introduction-to-Thread.md index ebf1de6..3cc5e28 100644 --- a/zh/chapter3-Thread/Introduction-to-Thread.md +++ b/zh/chapter3-Thread/Introduction-to-Thread.md @@ -468,7 +468,7 @@ thread& operator=(const thread&) = delete; t2.join(); } -- yield: 当前线程放弃执行,操作系统调度另一线程继续执行。 +- yield: 当前线程放弃执行,操作系统调度另一线程继续执行,一般地,系统是会调度另一个相同优先级的线程继续执行,如果当前优先级只有这一个线程,那么yield()没有作用,此时下面的代码输出就还是100。 #include #include @@ -524,4 +524,4 @@ thread& operator=(const thread&) = delete; 执行结果如下: Hello waiter - Waited 2000 ms \ No newline at end of file + Waited 2000 ms