Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yunqingabc
rt-thread
提交
4db9cfbe
R
rt-thread
项目概览
yunqingabc
/
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,发现更多精彩内容 >>
提交
4db9cfbe
编写于
1月 24, 2022
作者:
xiaozhao86
提交者:
guo
1月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
return thread error when resumed by signal
上级
3e59cfd7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
11 deletion
+16
-11
components/drivers/ipc/waitqueue.c
components/drivers/ipc/waitqueue.c
+6
-1
src/ipc.c
src/ipc.c
+1
-8
src/thread.c
src/thread.c
+9
-2
未找到文件。
components/drivers/ipc/waitqueue.c
浏览文件 @
4db9cfbe
...
...
@@ -7,6 +7,7 @@
* Date Author Notes
* 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon
* to blocked thread.
* 2022-01-24 THEWON let rt_wqueue_wait return thread->error when using signal
*/
#include <stdint.h>
...
...
@@ -141,6 +142,10 @@ int rt_wqueue_wait(rt_wqueue_t *queue, int condition, int msec)
rt_list_init
(
&
__wait
.
list
);
level
=
rt_hw_interrupt_disable
();
/* reset thread error */
tid
->
error
=
RT_EOK
;
if
(
queue
->
flag
==
RT_WQ_FLAG_WAKEUP
)
{
/* already wakeup */
...
...
@@ -171,5 +176,5 @@ __exit_wakeup:
rt_wqueue_remove
(
&
__wait
);
return
0
;
return
tid
->
error
;
}
src/ipc.c
浏览文件 @
4db9cfbe
...
...
@@ -40,6 +40,7 @@
* 2021-01-03 Meco Man implement rt_mb_urgent()
* 2021-05-30 Meco Man implement rt_mutex_trytake()
* 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to ipc.c
* 2022-01-24 THEWON let rt_mutex_take return thread->error when using signal
*/
#include <rtthread.h>
...
...
@@ -947,9 +948,6 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
}
else
{
#ifdef RT_USING_SIGNALS
__again:
#endif
/* RT_USING_SIGNALS */
/* The value of mutex is 1 in initial status. Therefore, if the
* value is great than 0, it indicates the mutex is avaible.
*/
...
...
@@ -1026,11 +1024,6 @@ __again:
if
(
thread
->
error
!=
RT_EOK
)
{
#ifdef RT_USING_SIGNALS
/* interrupt by signal, try it again */
if
(
thread
->
error
==
-
RT_EINTR
)
goto
__again
;
#endif
/* RT_USING_SIGNALS */
/* return error */
return
thread
->
error
;
}
...
...
src/thread.c
浏览文件 @
4db9cfbe
...
...
@@ -30,6 +30,7 @@
* 2021-11-15 THEWON Remove duplicate work between idle and _thread_exit
* 2021-12-27 Meco Man remove .init_priority
* 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to thread.c
* 2022-01-24 THEWON let rt_thread_sleep return thread->error when using signal
*/
#include <rthw.h>
...
...
@@ -566,6 +567,9 @@ rt_err_t rt_thread_sleep(rt_tick_t tick)
/* disable interrupt */
temp
=
rt_hw_interrupt_disable
();
/* reset thread error */
thread
->
error
=
RT_EOK
;
/* suspend thread */
rt_thread_suspend
(
thread
);
...
...
@@ -582,7 +586,7 @@ rt_err_t rt_thread_sleep(rt_tick_t tick)
if
(
thread
->
error
==
-
RT_ETIMEOUT
)
thread
->
error
=
RT_EOK
;
return
RT_EOK
;
return
thread
->
error
;
}
/**
...
...
@@ -625,6 +629,9 @@ rt_err_t rt_thread_delay_until(rt_tick_t *tick, rt_tick_t inc_tick)
/* disable interrupt */
level
=
rt_hw_interrupt_disable
();
/* reset thread error */
thread
->
error
=
RT_EOK
;
cur_tick
=
rt_tick_get
();
if
(
cur_tick
-
*
tick
<
inc_tick
)
{
...
...
@@ -657,7 +664,7 @@ rt_err_t rt_thread_delay_until(rt_tick_t *tick, rt_tick_t inc_tick)
rt_hw_interrupt_enable
(
level
);
}
return
RT_EOK
;
return
thread
->
error
;
}
RTM_EXPORT
(
rt_thread_delay_until
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录