1 Star 0 Fork 32

jinag12/gazelle_1

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0190-rtc-adapt-rtc_close.patch 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
From cba42b0ca25bed62c946a4d902deb82ce0ca74e9 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Sat, 2 Mar 2024 13:44:20 +0800
Subject: [PATCH] rtc: adapt rtc_close
---
src/lstack/api/lstack_epoll.c | 4 +++-
src/lstack/api/lstack_rtc_api.c | 12 +++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index 7dbef9d..6ae0eec 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -322,7 +322,9 @@ int32_t lstack_epoll_close(int32_t fd)
wakeup->type = WAKEUP_CLOSE;
- stack_broadcast_clean_epoll(wakeup);
+ if (!get_global_cfg_params()->stack_mode_rtc) {
+ stack_broadcast_clean_epoll(wakeup);
+ }
struct list_node *node, *temp;
pthread_spin_lock(&wakeup->event_list_lock);
diff --git a/src/lstack/api/lstack_rtc_api.c b/src/lstack/api/lstack_rtc_api.c
index 2e10e30..18664ca 100644
--- a/src/lstack/api/lstack_rtc_api.c
+++ b/src/lstack/api/lstack_rtc_api.c
@@ -63,7 +63,17 @@ int rtc_socket(int domain, int type, int protocol)
int rtc_close(int s)
{
- return lwip_close(s);
+ struct lwip_sock *sock = get_socket(s);
+ if (sock != NULL && sock->wakeup != NULL && sock->wakeup->epollfd == s) {
+ return lstack_epoll_close(s);
+ }
+
+ lwip_close(s);
+ if (sock != NULL) {
+ list_del_node_null(&sock->event_list);
+ }
+
+ return posix_api->close_fn(s);
}
int rtc_shutdown(int fd, int how)
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jiangheng12/gazelle_1.git
git@gitee.com:jiangheng12/gazelle_1.git
jiangheng12
gazelle_1
gazelle_1
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385