1 Star 0 Fork 32

吴昌盛/gazelle-tar

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0193-check-and-fix-wakeup_list-when-null-appears.patch 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
From 9fd7ce8ede4f5fcb730137d2593bfb8f470fad56 Mon Sep 17 00:00:00 2001
From: kircher <majun65@huawei.com>
Date: Tue, 21 Feb 2023 17:08:29 +0800
Subject: [PATCH] check and fix wakeup_list when null appears
---
src/lstack/api/lstack_epoll.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index 7860163..da29590 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -84,6 +84,17 @@ void wakeup_stack_epoll(struct protocol_stack *stack, bool wakeup_thread_enable)
struct list_node *node, *temp;
list_for_each_safe(node, temp, &stack->wakeup_list) {
+ /* When temp is NULL, find the tail node in the wekeup_list and connect it to the back of the node */
+ if (unlikely(temp == NULL)) {
+ struct list_node *nod = &stack->wakeup_list;
+ while (nod->prev && nod->prev != node) {
+ nod = nod->prev;
+ }
+ nod->prev = node;
+ node->next = nod;
+ temp = nod;
+ }
+
struct wakeup_poll *wakeup = container_of((node - stack->queue_id), struct wakeup_poll, wakeup_list);
if (!wakeup_thread_enable) {
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu-changsheng/gazelle-tar.git
git@gitee.com:wu-changsheng/gazelle-tar.git
wu-changsheng
gazelle-tar
gazelle-tar
master

搜索帮助