Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
u010088926
rt-thread
提交
0880b434
R
rt-thread
项目概览
u010088926
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0880b434
编写于
8月 09, 2021
作者:
B
Bernard Xiong
提交者:
GitHub
8月 09, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4911 from mysterywolf/rt_delayed_work_init
[workqueue] remove rt_delayed_work_init()
上级
b3ea49c8
94ed55f3
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
23 deletion
+9
-23
components/drivers/include/ipc/workqueue.h
components/drivers/include/ipc/workqueue.h
+1
-8
components/drivers/src/workqueue.c
components/drivers/src/workqueue.c
+2
-7
components/net/sal_socket/src/sal_socket.c
components/net/sal_socket/src/sal_socket.c
+6
-8
未找到文件。
components/drivers/include/ipc/workqueue.h
浏览文件 @
0880b434
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*
*
* Change Logs:
* Change Logs:
* Date Author Notes
* Date Author Notes
* 2021-08-01 Meco Man remove rt_delayed_work_init() and rt_delayed_work structure
*/
*/
#ifndef WORKQUEUE_H__
#ifndef WORKQUEUE_H__
#define WORKQUEUE_H__
#define WORKQUEUE_H__
...
@@ -48,11 +49,6 @@ struct rt_work
...
@@ -48,11 +49,6 @@ struct rt_work
struct
rt_workqueue
*
workqueue
;
struct
rt_workqueue
*
workqueue
;
};
};
struct
rt_delayed_work
{
struct
rt_work
work
;
};
#ifdef RT_USING_HEAP
#ifdef RT_USING_HEAP
/**
/**
* WorkQueue for DeviceDriver
* WorkQueue for DeviceDriver
...
@@ -82,9 +78,6 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo
...
@@ -82,9 +78,6 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo
work
->
type
=
0
;
work
->
type
=
0
;
}
}
void
rt_delayed_work_init
(
struct
rt_delayed_work
*
work
,
void
(
*
work_func
)(
struct
rt_work
*
work
,
void
*
work_data
),
void
*
work_data
);
#endif
/* RT_USING_HEAP */
#endif
/* RT_USING_HEAP */
#endif
#endif
components/drivers/src/workqueue.c
浏览文件 @
0880b434
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
*
*
* Change Logs:
* Change Logs:
* Date Author Notes
* Date Author Notes
* 2017-02-27 bernard fix the re-work issue.
* 2017-02-27 Bernard fix the re-work issue.
* 2021-08-01 Meco Man remove rt_delayed_work_init()
*/
*/
#include <rthw.h>
#include <rthw.h>
...
@@ -339,12 +340,6 @@ rt_err_t rt_workqueue_cancel_all_work(struct rt_workqueue *queue)
...
@@ -339,12 +340,6 @@ rt_err_t rt_workqueue_cancel_all_work(struct rt_workqueue *queue)
return
RT_EOK
;
return
RT_EOK
;
}
}
void
rt_delayed_work_init
(
struct
rt_delayed_work
*
work
,
void
(
*
work_func
)(
struct
rt_work
*
work
,
void
*
work_data
),
void
*
work_data
)
{
rt_work_init
(
&
work
->
work
,
work_func
,
work_data
);
}
#ifdef RT_USING_SYSTEM_WORKQUEUE
#ifdef RT_USING_SYSTEM_WORKQUEUE
static
struct
rt_workqueue
*
sys_workq
;
static
struct
rt_workqueue
*
sys_workq
;
...
...
components/net/sal_socket/src/sal_socket.c
浏览文件 @
0880b434
...
@@ -165,7 +165,6 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
...
@@ -165,7 +165,6 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
struct
netdev
*
netdev
=
(
struct
netdev
*
)
work_data
;
struct
netdev
*
netdev
=
(
struct
netdev
*
)
work_data
;
socklen_t
addr_len
=
sizeof
(
struct
sockaddr_in
);
socklen_t
addr_len
=
sizeof
(
struct
sockaddr_in
);
char
send_data
[
SAL_INTERNET_BUFF_LEN
],
recv_data
=
0
;
char
send_data
[
SAL_INTERNET_BUFF_LEN
],
recv_data
=
0
;
struct
rt_delayed_work
*
delay_work
=
(
struct
rt_delayed_work
*
)
work
;
const
char
month
[][
SAL_INTERNET_MONTH_LEN
]
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
const
char
month
[][
SAL_INTERNET_MONTH_LEN
]
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
char
date
[
SAL_INTERNET_DATE_LEN
];
char
date
[
SAL_INTERNET_DATE_LEN
];
...
@@ -176,7 +175,7 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
...
@@ -176,7 +175,7 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
if
(
work
)
if
(
work
)
{
{
rt_free
(
delay_
work
);
rt_free
(
work
);
}
}
/* get network interface socket operations */
/* get network interface socket operations */
...
@@ -287,18 +286,18 @@ int sal_check_netdev_internet_up(struct netdev *netdev)
...
@@ -287,18 +286,18 @@ int sal_check_netdev_internet_up(struct netdev *netdev)
#ifdef SAL_INTERNET_CHECK
#ifdef SAL_INTERNET_CHECK
/* workqueue for network connect */
/* workqueue for network connect */
struct
rt_
delayed_
work
*
net_work
=
RT_NULL
;
struct
rt_work
*
net_work
=
RT_NULL
;
net_work
=
(
struct
rt_
delayed_work
*
)
rt_calloc
(
1
,
sizeof
(
struct
rt_delayed
_work
));
net_work
=
(
struct
rt_
work
*
)
rt_calloc
(
1
,
sizeof
(
struct
rt
_work
));
if
(
net_work
==
RT_NULL
)
if
(
net_work
==
RT_NULL
)
{
{
LOG_W
(
"No memory for network interface device(%s) delay work."
,
netdev
->
name
);
LOG_W
(
"No memory for network interface device(%s) delay work."
,
netdev
->
name
);
return
-
1
;
return
-
1
;
}
}
rt_
delayed_
work_init
(
net_work
,
check_netdev_internet_up_work
,
(
void
*
)
netdev
);
rt_work_init
(
net_work
,
check_netdev_internet_up_work
,
(
void
*
)
netdev
);
rt_work_submit
(
&
(
net_work
->
work
)
,
RT_TICK_PER_SECOND
);
rt_work_submit
(
net_work
,
RT_TICK_PER_SECOND
);
#endif
/* SAL_INTERNET_CHECK */
#endif
/* SAL_INTERNET_CHECK */
return
0
;
return
0
;
}
}
...
@@ -1176,4 +1175,3 @@ void sal_freeaddrinfo(struct addrinfo *ai)
...
@@ -1176,4 +1175,3 @@ void sal_freeaddrinfo(struct addrinfo *ai)
pf
->
netdb_ops
->
freeaddrinfo
(
ai
);
pf
->
netdb_ops
->
freeaddrinfo
(
ai
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录