We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f205d5b commit 1740f39Copy full SHA for 1740f39
nginx/src/core/ngx_thread_pool.c
@@ -41,6 +41,7 @@ typedef struct {
41
42
43
// 描述一个线程池,与thread_pool指令对应
44
+// 此结构体的实际定义在c文件里,外部不可见,深度定制则不方便
45
// 存储在ngx_thread_pool_conf_t里的数组里
46
// 核心成员是queue,存储待处理任务
47
struct ngx_thread_pool_s {
@@ -60,6 +61,7 @@ struct ngx_thread_pool_s {
60
61
// 条件变量,用于等待任务队列queue
62
ngx_thread_cond_t cond;
63
64
+ // 日志对象,多线程操作也是安全的
65
ngx_log_t *log;
66
67
// 线程池的名字
nginx/src/core/ngx_thread_pool.h
@@ -74,6 +74,7 @@ struct ngx_thread_task_s {
74
75
76
// 线程池结构体
77
78
// 线程的数量默认为32个线程
79
// 任务等待队列默认是65535
80
typedef struct ngx_thread_pool_s ngx_thread_pool_t;
0 commit comments