Skip to content

Commit 7c00795

Browse files
authored
Merge pull request #4852 from mysterywolf/rmovefifo
[kernel][ipc] 移除mutex RT_IPC_FLAG_FIFO 功能
2 parents 262f54e + 6e33441 commit 7c00795

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/ipc.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ RTM_EXPORT(rt_sem_control);
548548
*/
549549
rt_err_t rt_mutex_init(rt_mutex_t mutex, const char *name, rt_uint8_t flag)
550550
{
551+
(void)flag;
552+
551553
/* parameter check */
552554
RT_ASSERT(mutex != RT_NULL);
553555

@@ -562,8 +564,8 @@ rt_err_t rt_mutex_init(rt_mutex_t mutex, const char *name, rt_uint8_t flag)
562564
mutex->original_priority = 0xFF;
563565
mutex->hold = 0;
564566

565-
/* set flag */
566-
mutex->parent.parent.flag = flag;
567+
/* flag can only be RT_IPC_FLAG_PRIO. RT_IPC_FLAG_FIFO cannot solve the unbounded priority inversion problem */
568+
mutex->parent.parent.flag = RT_IPC_FLAG_PRIO;
567569

568570
return RT_EOK;
569571
}
@@ -609,6 +611,7 @@ RTM_EXPORT(rt_mutex_detach);
609611
rt_mutex_t rt_mutex_create(const char *name, rt_uint8_t flag)
610612
{
611613
struct rt_mutex *mutex;
614+
(void)flag;
612615

613616
RT_DEBUG_NOT_IN_INTERRUPT;
614617

@@ -625,8 +628,8 @@ rt_mutex_t rt_mutex_create(const char *name, rt_uint8_t flag)
625628
mutex->original_priority = 0xFF;
626629
mutex->hold = 0;
627630

628-
/* set flag */
629-
mutex->parent.parent.flag = flag;
631+
/* flag can only be RT_IPC_FLAG_PRIO. RT_IPC_FLAG_FIFO cannot solve the unbounded priority inversion problem */
632+
mutex->parent.parent.flag = RT_IPC_FLAG_PRIO;
630633

631634
return mutex;
632635
}

0 commit comments

Comments
 (0)