亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tx_tprch.c

?? ThreadX優(yōu)秀的硬實時操作系統(tǒng).This Express Start Guide is designed to help you install and use ThreadX for the
?? C
字號:
/**************************************************************************/ 
/*                                                                        */ 
/*            Copyright (c) 1996-2000 by Express Logic Inc.               */ 
/*                                                                        */ 
/*  This software is copyrighted by and is the sole property of Express   */ 
/*  Logic, Inc.  All rights, title, ownership, or other interests         */ 
/*  in the software remain the property of Express Logic, Inc.  This      */ 
/*  software may only be used in accordance with the corresponding        */ 
/*  license agreement.  Any unauthorized use, duplication, transmission,  */ 
/*  distribution, or disclosure of this software is expressly forbidden.  */ 
/*                                                                        */
/*  This Copyright notice may not be removed or modified without prior    */ 
/*  written consent of Express Logic, Inc.                                */ 
/*                                                                        */ 
/*  Express Logic, Inc. reserves the right to modify this software        */ 
/*  without notice.                                                       */ 
/*                                                                        */ 
/*  Express Logic, Inc.                                                   */
/*  11440 West Bernardo Court               info@expresslogic.com         */
/*  Suite 366                               http://www.expresslogic.com   */
/*  San Diego, CA  92127                                                  */
/*                                                                        */
/**************************************************************************/


/**************************************************************************/
/**************************************************************************/
/**                                                                       */ 
/** ThreadX Component                                                     */ 
/**                                                                       */
/**   Thread Control (THR)                                                */
/**                                                                       */
/**************************************************************************/
/**************************************************************************/

#define TX_SOURCE_CODE


/* Include necessary system files.  */

#include    "tx_api.h"
#include    "tx_thr.h"


/**************************************************************************/ 
/*                                                                        */ 
/*  FUNCTION                                               RELEASE        */ 
/*                                                                        */ 
/*    _tx_thread_priority_change                          PORTABLE C      */ 
/*                                                           3.0f         */ 
/*  AUTHOR                                                                */ 
/*                                                                        */ 
/*    William E. Lamie, Express Logic, Inc.                               */ 
/*                                                                        */ 
/*  DESCRIPTION                                                           */ 
/*                                                                        */ 
/*    This function changes the priority of the specified thread.  It     */ 
/*    also returns the old priority and handles preemption if the calling */ 
/*    thread is currently executing and the priority change results in a  */ 
/*    higher priority thread ready for execution.                         */ 
/*                                                                        */ 
/*    Note: the preemption threshold is automatically changed to the new  */ 
/*    priority.                                                           */
/*                                                                        */ 
/*  INPUT                                                                 */ 
/*                                                                        */ 
/*    thread_ptr                            Pointer to thread to suspend  */ 
/*    new_priority                          New thread priority           */ 
/*    old_priority                          Old thread priority           */ 
/*                                                                        */ 
/*  OUTPUT                                                                */ 
/*                                                                        */ 
/*    status                                Completion status             */ 
/*                                                                        */ 
/*  CALLS                                                                 */ 
/*                                                                        */ 
/*    _tx_thread_system_return              Return to system if self-     */ 
/*                                            suspension                  */ 
/*                                                                        */ 
/*  CALLED BY                                                             */ 
/*                                                                        */ 
/*    Application Code                                                    */ 
/*                                                                        */ 
/*  RELEASE HISTORY                                                       */ 
/*                                                                        */ 
/*    DATE              NAME                      DESCRIPTION             */ 
/*                                                                        */ 
/*  12-31-1996     William E. Lamie         Initial Version 3.0           */ 
/*  07-04-1997     William E. Lamie         Added casting of local        */ 
/*                                            priority_group variable in  */ 
/*                                            order to avoid compiler     */ 
/*                                            warnings, resulting in      */ 
/*                                            version 3.0a.               */ 
/*  11-11-1997     William E. Lamie         Modified comment(s),          */ 
/*                                            resulting in version 3.0b.  */ 
/*  03-01-1998     William E. Lamie         Corrected casting in making   */ 
/*                                            new priority bit map, and   */ 
/*                                            added clearing of bit in    */ 
/*                                            preempted map if thread is  */ 
/*                                            head of the priority list,  */ 
/*                                            resulting in version 3.0d.  */ 
/*  01-01-1999     William E. Lamie         Modified comment(s),          */ 
/*                                            resulting in version 3.0e.  */ 
/*  11-01-1999     William E. Lamie         Modified comment(s),          */ 
/*                                            added logic to track events,*/ 
/*                                            resulting in version 3.0f.  */ 
/*                                                                        */ 
/**************************************************************************/ 
UINT    _tx_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority, UINT *old_priority)
{

TX_INTERRUPT_SAVE_AREA

REG_1 UINT      priority;               /* Thread priority          */
REG_2 ULONG     priority_map;           /* Working priority map     */
REG_3 UCHAR     priority_group;         /* Priority group           */


    /* Determine if the priority is legal.  */
    if (new_priority >= TX_MAX_PRIORITIES)
    
        /* Return an error status.  */
        return(TX_PRIORITY_ERROR);

    /* Lockout interrupts while the thread is being suspended.  */
    TX_DISABLE

    /* Save the previous priority.  */
    *old_priority =  thread_ptr -> tx_priority;

    /* Log this kernel call.  */
    TX_EL_THREAD_PRIORITY_CHANGE_INSERT

    /* Determine if this thread is currently ready.  */
    if (thread_ptr -> tx_state != TX_READY)
    {

        /* Easy, just setup the priority and threshold in the thread's control
           block.  */
        thread_ptr -> tx_priority =           new_priority;
        thread_ptr -> tx_preempt_threshold =  new_priority;

        /* Setup the new priority bit.  */
        thread_ptr -> tx_priority_bit =       (((ULONG) 1) << new_priority);

        /* Restore interrupts.  */
        TX_RESTORE
    }
    else
    {

        /* The thread is ready and must first be removed from the list.  */

        /* Pickup priority of thread.  */
        priority =  thread_ptr -> tx_priority;

        /* Determine if there are other threads at this priority that are
           ready.  */
        if (thread_ptr -> tx_ready_next != thread_ptr)
        {

            /* Yes, there are other threads at this priority ready.  */
    
            /* Adjust the head pointer if this thread is at the front
               of the list.  */
            if (_tx_thread_priority_list[priority] == thread_ptr)
            {

                /* Setup a new head pointer at this priority.  */
	            _tx_thread_priority_list[priority] =  thread_ptr -> tx_ready_next;

                /* Clear the corresponding bit in the preempted map.  */
                _tx_thread_preempted_map =  _tx_thread_preempted_map & ~(thread_ptr -> tx_priority_bit);
            }
    
            /* Just remove this thread from the priority list.  */
            (thread_ptr -> tx_ready_next) -> tx_ready_previous =    thread_ptr -> tx_ready_previous;
            (thread_ptr -> tx_ready_previous) -> tx_ready_next =    thread_ptr -> tx_ready_next;

            /* Setup the new priority bit.  */
            thread_ptr -> tx_priority_bit =     (((ULONG) 1) << new_priority);
        }
        else
        {

            /* This is the only thread at this priority ready to run.  Set the head 
               pointer to NULL.  */
            _tx_thread_priority_list[priority] =    TX_NULL;

            /* Clear this priority bit in the ready priority bit map.  */
            _tx_thread_priority_map =  _tx_thread_priority_map & ~(thread_ptr -> tx_priority_bit);

            /* Clear this priority bit in the preempted bit map just in case.  */
            _tx_thread_preempted_map =  _tx_thread_preempted_map & ~(thread_ptr -> tx_priority_bit);

            /* Setup the new priority bit.  */
            thread_ptr -> tx_priority_bit =  (((ULONG) 1) << new_priority);

            /* Put the priority map in a working copy.  */
            priority_map =  _tx_thread_priority_map;

            /* Find the next highest priority.  */

            /* Check for priorities 0-7.  */
            priority_group =  (UCHAR) (priority_map & TX_THREAD_PRIORITY_GROUP_MASK);
            if (priority_group)
                _tx_thread_highest_priority =  _tx_thread_lowest_bit[priority_group];		
            else
            {
		
                /* Check for priorities 8-15.  */
                priority_map =    priority_map >> TX_THREAD_GROUP_SIZE;
                priority_group =  (UCHAR) (priority_map & TX_THREAD_PRIORITY_GROUP_MASK);
                if (priority_group)
                    _tx_thread_highest_priority =  
                           TX_THREAD_GROUP_1 + _tx_thread_lowest_bit[priority_group];
                else
                {

                    /* Check for priorities 16-23.  */
                    priority_map =    priority_map >> TX_THREAD_GROUP_SIZE;
                    priority_group =  (UCHAR) (priority_map & TX_THREAD_PRIORITY_GROUP_MASK);
                    if (priority_group)
                        _tx_thread_highest_priority =  
                                    TX_THREAD_GROUP_2 + _tx_thread_lowest_bit[priority_group];
                    else
                    {

                        priority_map =    priority_map >> TX_THREAD_GROUP_SIZE;
                        priority_group =  (UCHAR) (priority_map & TX_THREAD_PRIORITY_GROUP_MASK);
                        if (priority_group)
                            _tx_thread_highest_priority =  
                                    TX_THREAD_GROUP_3 + _tx_thread_lowest_bit[priority_group];
                        else

                            /* No more priorities, set highest priority accordingly.  */
                            _tx_thread_highest_priority =  TX_MAX_PRIORITIES;
                    }
                }
            }
        }

        /* Determine if this thread is the thread designated to execute.  */
        if (thread_ptr == _tx_thread_execute_ptr)
        {

            /* Pickup the highest priority thread to execute, if there is
               one.  */
	        if (_tx_thread_highest_priority != TX_MAX_PRIORITIES)

                /* Setup the next thread to execute.  */
                _tx_thread_execute_ptr =  _tx_thread_priority_list[_tx_thread_highest_priority];
            else

                /* No more threads ready to execute, set execute pointer to NULL.  */
                _tx_thread_execute_ptr =  TX_NULL;
        }

        /* Okay at this point, the thread is off of the list.  Temporarily setup the 
           preemption threshold to prevent any other thread from running.  */
        thread_ptr -> tx_preempt_threshold =  0;

        /* Setup the new thread priority.  */
        thread_ptr -> tx_priority =  new_priority;

        /* Set the state to suspended so the resume function will work. */
        thread_ptr -> tx_state =  TX_SUSPENDED;

        /* Temporarily disable preemption.  */
        _tx_thread_preempt_disable++;
        
        /* Restore interrupts temporarily. */
        TX_RESTORE

        /* Resume this thread.  */
        _tx_thread_resume(thread_ptr);

        /* Setup the preempt threshold.  */
        thread_ptr -> tx_preempt_threshold =  new_priority;

        /* Determine if a context switch is required.  */
        if ((_tx_thread_current_ptr != _tx_thread_execute_ptr) &&
            (_tx_thread_system_state == 0))

            /* Return control to the system.  */
            _tx_thread_system_return();
    }

    /* Return success if we get here!  */
    return(TX_SUCCESS);
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情开心网| 久久99九九99精品| 91美女片黄在线观看91美女| 中文字幕一区二区三区av| 国产丶欧美丶日本不卡视频| 中文字幕乱码久久午夜不卡| 成人av在线网站| 亚洲人快播电影网| 欧美视频一区在线| 美女一区二区视频| 国产亚洲一二三区| 91丨九色丨黑人外教| 亚洲午夜精品网| 欧美不卡一二三| 国产精品一区2区| 亚洲视频一二区| 欧美高清精品3d| 韩国精品主播一区二区在线观看| 中文字幕成人av| 欧美三级日韩在线| 韩国一区二区三区| 日韩毛片一二三区| 在线成人免费观看| 国产.欧美.日韩| 亚洲图片欧美一区| 欧美精品一区二区三区四区| 波多野结衣在线一区| 亚洲大尺度视频在线观看| 欧美tickling网站挠脚心| 99视频有精品| 青青青伊人色综合久久| 国产精品福利在线播放| 欧美精品vⅰdeose4hd| 高清国产一区二区| 婷婷久久综合九色综合伊人色| 久久你懂得1024| 欧美精品在线视频| 成人伦理片在线| 麻豆精品国产传媒mv男同| 国产精品久久毛片av大全日韩| 51精品久久久久久久蜜臀| youjizz国产精品| 美女脱光内衣内裤视频久久网站| 国产精品不卡在线| 欧美成人精品福利| 欧美理论片在线| 91网站在线观看视频| 精品一区二区三区不卡| 一区二区三区不卡视频 | 1024国产精品| 日韩一区二区在线观看| 97超碰欧美中文字幕| 紧缚奴在线一区二区三区| 亚洲国产精品一区二区久久 | 欧美无砖砖区免费| 高清日韩电视剧大全免费| 免费不卡在线观看| 亚洲成a人v欧美综合天堂 | 99久久777色| 国产在线精品一区二区三区不卡| 午夜精品福利视频网站| 亚洲欧洲中文日韩久久av乱码| 久久久久国产精品免费免费搜索| 欧美一区二视频| 欧美亚洲国产一区二区三区| av午夜一区麻豆| 成人一区二区三区| 国产剧情在线观看一区二区| 久久丁香综合五月国产三级网站| 午夜不卡av免费| 亚洲成人1区2区| 亚洲成av人**亚洲成av**| 亚洲精选在线视频| 亚洲视频每日更新| 18成人在线观看| 亚洲日本青草视频在线怡红院| 国产欧美久久久精品影院| 久久久影院官网| 久久欧美一区二区| 国产日韩亚洲欧美综合| 久久―日本道色综合久久| 久久久噜噜噜久久人人看 | 亚洲一区二区三区四区五区黄| 亚洲婷婷综合久久一本伊一区| 中文av字幕一区| 国产精品成人午夜| 亚洲免费视频中文字幕| 一区二区三区中文字幕电影| 一区二区三区免费网站| 亚洲国产成人av好男人在线观看| 亚洲国产一区视频| 青青国产91久久久久久| 蜜桃免费网站一区二区三区| 久久99国产精品久久99| 国产98色在线|日韩| 99视频精品免费视频| 色婷婷av一区二区| 欧美精品一卡二卡| 久久夜色精品国产噜噜av| 欧美激情在线免费观看| 中文字幕一区二区三中文字幕| 中文字幕一区在线观看| 亚洲在线观看免费视频| 日韩va亚洲va欧美va久久| 精品一区二区三区在线播放视频| 国产乱码一区二区三区| 91蜜桃视频在线| 欧美精品在线一区二区三区| 2021久久国产精品不只是精品| 亚洲国产高清aⅴ视频| 亚洲综合区在线| 久久国产婷婷国产香蕉| 成人激情校园春色| 欧美日韩极品在线观看一区| 精品国产免费一区二区三区四区 | 国产精品福利影院| 午夜精品久久久久久久久久 | 欧美国产日韩一二三区| 亚洲精品成a人| 另类小说综合欧美亚洲| av在线不卡免费看| 制服丝袜亚洲色图| 国产农村妇女精品| 日韩精品欧美精品| av在线不卡网| 日韩免费性生活视频播放| 1区2区3区精品视频| 久久99在线观看| 色成人在线视频| 欧美精品一区二区精品网| 亚洲人午夜精品天堂一二香蕉| 久久超碰97中文字幕| 色偷偷88欧美精品久久久| 久久久久久综合| 天天av天天翘天天综合网| 亚洲一二三四在线| 日韩西西人体444www| 中文字幕久久午夜不卡| 一区二区三区日韩精品视频| 国产一区二区三区日韩 | 蜜桃视频一区二区三区在线观看| 丁香亚洲综合激情啪啪综合| 在线不卡免费av| 一区二区欧美在线观看| 国产成人综合网站| 日韩一级大片在线观看| 亚洲国产成人精品视频| 成人免费高清在线| 久久亚洲捆绑美女| 欧美a级一区二区| 欧美日韩午夜在线视频| 综合精品久久久| 成人免费高清视频在线观看| 精品久久久久久久久久久久包黑料 | 亚洲精品自拍动漫在线| 高潮精品一区videoshd| 精品国产99国产精品| 天天射综合影视| 欧美在线观看18| 亚洲天堂中文字幕| www.66久久| 中文字幕一区二区三区色视频| 狠狠色狠狠色合久久伊人| 7777精品伊人久久久大香线蕉最新版| 亚洲人成7777| 91亚洲国产成人精品一区二三| 亚洲国产精品av| 成人视屏免费看| 亚洲国产精华液网站w| 成人少妇影院yyyy| 国产精品午夜久久| 成人精品电影在线观看| 国产精品国产三级国产| 99re视频精品| 亚洲理论在线观看| 欧美午夜电影在线播放| 亚洲123区在线观看| 欧美猛男超大videosgay| 石原莉奈在线亚洲二区| 日韩亚洲欧美一区二区三区| 久久69国产一区二区蜜臀| 欧美精品一区男女天堂| 国产精品综合久久| 国产欧美日韩视频在线观看| 成人av在线资源网| 亚洲美女视频在线观看| 欧美丝袜第三区| 琪琪一区二区三区| 久久精品欧美一区二区三区麻豆 | 日本午夜精品一区二区三区电影| 欧美日韩五月天| 男男成人高潮片免费网站| 精品成人免费观看| 岛国精品一区二区| 亚洲裸体xxx| 欧美精品视频www在线观看| 极品美女销魂一区二区三区| 中文字幕精品一区二区三区精品| 一本色道久久综合亚洲精品按摩| 亚洲电影激情视频网站|