?????????????????????????????????
???????????? ???????[ 2012/10/24 10:37:01 ] ????????
???????????????????????????????????????????????????????????????????檔????????????chg_pri_mutex???????????????change_interal_task_priority??????ж???????????????????????ж???ζ????????????????????????????????????????????????????
RAW_U8 chg_pri_mutex(RAW_TASK_OBJ *tcb?? RAW_U8 priority?? RAW_U16 *error)
{
RAW_MUTEX *mtxcb;
RAW_U8 hi_pri?? low_pri?? pri;
RAW_TASK_OBJ *first_block_task;
LIST *block_list_head;
hi_pri = priority;
low_pri = 0;
mtxcb = (RAW_MUTEX *)(tcb->block_obj);
if (mtxcb) {
/*if it is blocked on mutex*/
if (mtxcb->common_block_obj.object_type == RAW_MUTEX_OBJ_TYPE) {
if (mtxcb->policy == RAW_MUTEX_CEILING_POLICY) {
pri = mtxcb->ceiling_prio;
if (pri > low_pri) {
low_pri = pri;
}
}
}
}
/* Locked Mutex */
pri = hi_pri;
for (mtxcb = tcb->mtxlist; mtxcb != 0; mtxcb = mtxcb->mtxlist) {
switch (mtxcb->policy) {
case RAW_MUTEX_CEILING_POLICY:
pri = mtxcb->ceiling_prio;
if ( pri > low_pri ) {
low_pri = pri;
}
break;
case RAW_MUTEX_INHERIT_POLICY:
block_list_head = &mtxcb->common_block_obj.block_list;
if (!is_list_empty(block_list_head)) {
first_block_task = list_entry(block_list_head->next?? RAW_TASK_OBJ?? task_list);
pri = first_block_task->priority;
}
break;
default:
/* nothing to do */
break;
}
if ( pri < hi_pri ) {
hi_pri = pri;
}
}
if (priority < low_pri) {
*error = RAW_EXCEED_CEILING_PRIORITY;
return RAW_EXCEED_CEILING_PRIORITY;
}
*error = RAW_SUCCESS;
return hi_pri;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11