Skip to content

Commit

Permalink
Update about-exit.md
Browse files Browse the repository at this point in the history
  • Loading branch information
holmes1412 authored Jul 30, 2020
1 parent 5a7487d commit 47d5aec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/about-exit.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 关于程序退出

由于我们的大多数调用都是非阻塞的,所以在之前的示例里我们都需要用一些机制来防止main函数提前退出。
例如wget示例中等待用户的Ctrl-C,或者像parallel_wget在所有抓取结束之后唤醒主进程
而在几个server的示例中,stop()操作是阻塞的,可以确保所有server task的正常结束,主进程可安全退出
例如wget示例中等待用户的Ctrl-C,或者像parallel_wget在所有抓取结束之后唤醒主线程
而在几个server的示例中,stop()操作是阻塞的,可以确保所有server task的正常结束,主线程可安全退出

# 程序安全退出的原则

Expand Down Expand Up @@ -35,7 +35,7 @@ void log_callback(WFFileIOTask *log_task)
mutex.unlock();
}

void reply_callback(HttpTask *server_task)
void reply_callback(WFHttpTask *server_task)
{
WFFileIOTask *log_task = WFTaskFactory::create_pwrite_task(..., log_callback);

Expand Down

0 comments on commit 47d5aec

Please sign in to comment.