diff options
Diffstat (limited to 'examples/kernel/mutex_priority.c')
| -rwxr-xr-x | examples/kernel/mutex_priority.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/kernel/mutex_priority.c b/examples/kernel/mutex_priority.c index f647fc4039..a7702eed6f 100755 --- a/examples/kernel/mutex_priority.c +++ b/examples/kernel/mutex_priority.c @@ -1,4 +1,13 @@ /* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * + */ + +/* * 创建7个进程,tid20、tid21、tid22、tid23、tid24、tid25、tid26、tid27、tid28、tid29 * 各任务优先级分别为20、21、22、23、24、25、26、27、28、29, * 其中tid26最先获得锁,tid22不需要使用到互斥锁,其他所有进程均需要使用互斥锁, @@ -272,7 +281,7 @@ static void thread29_entry(void* parameter) static int mutex_simple_init() { /* 创建互斥锁 */ - mutex = rt_mutex_create("mutex", RT_IPC_FLAG_FIFO); + mutex = rt_mutex_create("mutex", RT_IPC_FLAG_PRIO); if (mutex == RT_NULL) { tc_stat(TC_STAT_END | TC_STAT_FAILED); |
