Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ihbai
rt-thread
提交
02331fd3
R
rt-thread
项目概览
ihbai
/
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,发现更多精彩内容 >>
提交
02331fd3
编写于
5月 17, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revert #3647
上级
3baad477
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
42 deletion
+0
-42
src/ipc.c
src/ipc.c
+0
-42
未找到文件。
src/ipc.c
浏览文件 @
02331fd3
...
@@ -38,7 +38,6 @@
...
@@ -38,7 +38,6 @@
* event without pending
* event without pending
* 2020-10-11 Meco Man add value overflow-check code
* 2020-10-11 Meco Man add value overflow-check code
* 2021-01-03 Meco Man add rt_mb_urgent()
* 2021-01-03 Meco Man add rt_mb_urgent()
* 2021-01-20 hupu fix priority inversion bug of mutex
*/
*/
#include <rtthread.h>
#include <rtthread.h>
...
@@ -192,31 +191,6 @@ rt_inline rt_err_t rt_ipc_list_resume_all(rt_list_t *list)
...
@@ -192,31 +191,6 @@ rt_inline rt_err_t rt_ipc_list_resume_all(rt_list_t *list)
return
RT_EOK
;
return
RT_EOK
;
}
}
/**
* This function will get the highest priority from the specified
* list of threads
*
* @param list of the threads
*
* @return the highest priority
*/
rt_uint8_t
rt_ipc_get_highest_priority
(
rt_list_t
*
list
)
{
struct
rt_list_node
*
n
;
struct
rt_thread
*
sthread
;
rt_uint8_t
priority
=
RT_THREAD_PRIORITY_MAX
-
1
;
for
(
n
=
list
->
next
;
n
!=
list
;
n
=
n
->
next
)
{
sthread
=
rt_list_entry
(
n
,
struct
rt_thread
,
tlist
);
priority
=
priority
<
sthread
->
current_priority
?
priority
:
sthread
->
current_priority
;
}
return
priority
;
}
#ifdef RT_USING_SEMAPHORE
#ifdef RT_USING_SEMAPHORE
/**
/**
* This function will initialize a semaphore and put it under control of
* This function will initialize a semaphore and put it under control of
...
@@ -855,7 +829,6 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
...
@@ -855,7 +829,6 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
register
rt_base_t
temp
;
register
rt_base_t
temp
;
struct
rt_thread
*
thread
;
struct
rt_thread
*
thread
;
rt_bool_t
need_schedule
;
rt_bool_t
need_schedule
;
rt_uint8_t
max_priority_in_queue
=
RT_THREAD_PRIORITY_MAX
-
1
;
/* parameter check */
/* parameter check */
RT_ASSERT
(
mutex
!=
RT_NULL
);
RT_ASSERT
(
mutex
!=
RT_NULL
);
...
@@ -917,21 +890,6 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
...
@@ -917,21 +890,6 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
mutex
->
owner
=
thread
;
mutex
->
owner
=
thread
;
mutex
->
original_priority
=
thread
->
current_priority
;
mutex
->
original_priority
=
thread
->
current_priority
;
/* Priority adjustment occurs only when the following conditions
* are met simultaneously:
* 1.The type of mutex is RT_IPC_FLAG_FIFO;
* 2.The priority of the thread to be resumed is not equal to the
* highest priority in the queue;
*/
max_priority_in_queue
=
rt_ipc_get_highest_priority
(
&
mutex
->
parent
.
suspend_thread
);
if
(
mutex
->
parent
.
parent
.
flag
==
RT_IPC_FLAG_FIFO
&&
thread
->
current_priority
!=
max_priority_in_queue
)
{
rt_thread_control
(
thread
,
RT_THREAD_CTRL_CHANGE_PRIORITY
,
&
(
max_priority_in_queue
));
}
if
(
mutex
->
hold
<
RT_MUTEX_HOLD_MAX
)
if
(
mutex
->
hold
<
RT_MUTEX_HOLD_MAX
)
{
{
mutex
->
hold
++
;
mutex
->
hold
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录