Skip to content

Commit 1740f39

Browse files
committed
ngx_thread_pool.c
1 parent f205d5b commit 1740f39

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

nginx/src/core/ngx_thread_pool.c

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ typedef struct {
4141

4242

4343
// 描述一个线程池,与thread_pool指令对应
44+
// 此结构体的实际定义在c文件里,外部不可见,深度定制则不方便
4445
// 存储在ngx_thread_pool_conf_t里的数组里
4546
// 核心成员是queue,存储待处理任务
4647
struct ngx_thread_pool_s {
@@ -60,6 +61,7 @@ struct ngx_thread_pool_s {
6061
// 条件变量,用于等待任务队列queue
6162
ngx_thread_cond_t cond;
6263

64+
// 日志对象,多线程操作也是安全的
6365
ngx_log_t *log;
6466

6567
// 线程池的名字

nginx/src/core/ngx_thread_pool.h

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ struct ngx_thread_task_s {
7474

7575

7676
// 线程池结构体
77+
// 此结构体的实际定义在c文件里,外部不可见,深度定制则不方便
7778
// 线程的数量默认为32个线程
7879
// 任务等待队列默认是65535
7980
typedef struct ngx_thread_pool_s ngx_thread_pool_t;

0 commit comments

Comments
 (0)