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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tx_efs.c

?? 該代碼是在單片機MCU中實現多線程的嵌入式操作系統
?? C
?? 第 1 頁 / 共 2 頁
字號:
/**************************************************************************/ 
/*                                                                        */ 
/*            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                                                     */ 
/**                                                                       */
/**   Event Flags (EVE)                                                   */
/**                                                                       */
/**************************************************************************/
/**************************************************************************/

#define TX_SOURCE_CODE


/* Include necessary system files.  */

#include    "tx_api.h"
#include    "tx_thr.h"
#include    "tx_tim.h"
#include    "tx_eve.h"


/**************************************************************************/ 
/*                                                                        */ 
/*  FUNCTION                                               RELEASE        */ 
/*                                                                        */ 
/*    _tx_event_flags_set                                 PORTABLE C      */ 
/*                                                           3.0f         */ 
/*  AUTHOR                                                                */ 
/*                                                                        */ 
/*    William E. Lamie, Express Logic, Inc.                               */ 
/*                                                                        */ 
/*  DESCRIPTION                                                           */ 
/*                                                                        */ 
/*    This function sets the specified flags in the event group based on  */ 
/*    the set option specified.  All threads suspended on the group whose */ 
/*    get request can now be satisfied are resumed.                       */ 
/*                                                                        */ 
/*  INPUT                                                                 */ 
/*                                                                        */ 
/*    group_ptr                         Pointer to group control block    */ 
/*    flags_to_set                      Event flags to set                */ 
/*    set_option                        Specified either AND or OR        */ 
/*                                        operation on the event flags    */ 
/*                                                                        */ 
/*  OUTPUT                                                                */ 
/*                                                                        */ 
/*    TX_SUCCESS                        Always returns success            */ 
/*                                                                        */ 
/*  CALLS                                                                 */ 
/*                                                                        */ 
/*    _tx_timer_deactivate              Deactivate timer routine          */ 
/*    _tx_thread_resume                 Resume thread service             */ 
/*    _tx_thread_system_return          Return to system routine          */ 
/*                                                                        */ 
/*  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         Corrected a problem setting   */ 
/*                                            event flags from ISRs with  */ 
/*                                            thread preemption, 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 problem building    */ 
/*                                            the satisfied thread list   */ 
/*                                            when two or more threads    */ 
/*                                            are satisfied, resulting in */ 
/*  01-01-1999     William E. Lamie         Corrected problem setting     */ 
/*                                            events from ISRs while the  */ 
/*                                            same event flag group is    */ 
/*                                            being set from a thread,    */ 
/*                                            resulting in version 3.0e.  */ 
/*  11-01-1999     William E. Lamie         Modified comment(s),          */ 
/*                                            added logic to track events,*/ 
/*                                            added logic the optimizes   */ 
/*                                            processing when a single    */ 
/*                                            thread is suspended on the  */ 
/*                                            event flag group, resulting */ 
/*                                            in version 3.0f.            */ 
/*                                                                        */ 
/**************************************************************************/ 
UINT    _tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, 
                    UINT set_option)
{

TX_INTERRUPT_SAVE_AREA

REG_1   UINT        status;                 /* Return status                 */
REG_2   TX_THREAD   *thread_ptr;            /* Working thread pointer        */
REG_3   TX_THREAD   *next_thread_ptr;       /* Next thread in satisfied list */
REG_4   TX_THREAD   *satisfied_list;        /* Event satisfied list pointer  */
REG_5   TX_THREAD   *last_satisfied;        /* Last satisfied pointer        */
TX_THREAD           *suspended_list;        /* Temporary copy of suspend list*/
ULONG               suspended_count;        /* Number of suspended threads   */ 
ULONG               current_event_flags;    /* Current event flags           */
UINT                get_option;             /* Suspended thread's get option */


    /* Disable interrupts to remove the semaphore from the created list.  */
    TX_DISABLE

    /* Log this kernel call.  */
    TX_EL_EVENT_FLAGS_SET_INSERT

    /* Determine how to set this group's event flags.  */
    if (set_option & TX_EVENT_FLAGS_AND_MASK)
    {

        /* "AND" the flags into the current events of the group.  */
        group_ptr -> tx_event_flags_current =
            group_ptr -> tx_event_flags_current & flags_to_set;
    
        /* There is no need to check for any suspended threads since no
           new bits are set.  */
        TX_RESTORE
        return(TX_SUCCESS);
    }
    else
    {

        /* "OR" the flags into the current events of the group.  */
        group_ptr -> tx_event_flags_current =
            group_ptr -> tx_event_flags_current | flags_to_set;
    }

    /* Determine if there are any threads suspended on the event flag group.  */
    if (group_ptr -> tx_event_flags_suspension_list)
    {

        /* Determine if there is just a single thread waiting on the event 
           flag group.  */
        if (group_ptr -> tx_event_flags_suspended_count == 1)
        {

            /* Single thread waiting for event flags.  Bypass the multiple thread
               logic.  */

            /* Setup thread pointer.  */
            thread_ptr =  group_ptr -> tx_event_flags_suspension_list;

            /* Determine if this thread's get event flag request has been met.  */
            if (thread_ptr -> tx_suspend_option & TX_EVENT_FLAGS_AND_MASK)
            {

                /* All flags must be present to satisfy request.  */
                if ((group_ptr -> tx_event_flags_current & thread_ptr -> tx_suspend_info) == 
                                                                thread_ptr -> tx_suspend_info)
    
                    /* Yes, all the events are present.  */
                    status =  TX_SUCCESS;
                else

                    /* No, not all the events are present.  */
                    status =  TX_NO_EVENTS;
            }
            else
            {

                /* Any of the events will satisfy the request.  */
                if (group_ptr -> tx_event_flags_current & thread_ptr -> tx_suspend_info)

                    /* Yes, one or more of the requested events are set.  */
                    status =  TX_SUCCESS;
                else
    
                    /* No, none of the events are currently set.  */
                    status =  TX_NO_EVENTS;
            }

            /* Was the suspended thread's event request satisfied?  */
            if (status == TX_SUCCESS)
            {

                /* Yes, resume the thread and apply any event flag
                   clearing.  */

                /* Return the actual event flags that satisfied the request.  */
                *((ULONG *) thread_ptr -> tx_additional_suspend_info) =  
                                                    group_ptr -> tx_event_flags_current;

                /* Determine whether or not clearing needs to take place.  */
                if (thread_ptr -> tx_suspend_option & TX_EVENT_FLAGS_CLEAR_MASK)
                {

                    /* Yes, clear the flags that satisfied this request.  */
                    group_ptr -> tx_event_flags_current =
                        group_ptr -> tx_event_flags_current & ~(thread_ptr -> tx_suspend_info);
                }

                /* Clear the suspension information in the event flag group.  */
                group_ptr -> tx_event_flags_suspension_list =  TX_NULL;
                group_ptr -> tx_event_flags_suspended_count =  0;

                /* Clear cleanup routine to avoid timeout.  */
                thread_ptr -> tx_suspend_cleanup =  TX_NULL;

                /* Temporarily disable preemption.  */
                _tx_thread_preempt_disable++;

                /* Restore interrupts.  */
                TX_RESTORE

                /* Deactivate the timeout timer if necessary.  */
                if (thread_ptr -> tx_thread_timer.tx_list_head)
                {

                    /* Deactivate the thread's timeout timer.  */
                    _tx_timer_deactivate(&(thread_ptr -> tx_thread_timer));
                }
                else
                {

                    /* Clear the remaining time to ensure timer doesn't get activated.  */
                    thread_ptr -> tx_thread_timer.tx_remaining_ticks =  0;
                }

                /* Put return status into the thread control block.  */
                thread_ptr -> tx_suspend_status =  TX_SUCCESS;        

                /* Resume thread.  */
                if (_tx_thread_resume(thread_ptr))

                    /* Preemption is required, transfer control back to 
                       system.  */
                    _tx_thread_system_return();

                /* Return successful status.  */
                return(TX_SUCCESS);    
            }
            else
            {

                /* Flags of single suspended thread were not satisfied.  */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃av一区二区三区| 日本一区中文字幕| 久久久久久久久伊人| 日韩亚洲欧美在线观看| 欧美精品久久99久久在免费线| 99久久免费精品| 成人黄色小视频在线观看| 国产91精品露脸国语对白| 国产麻豆精品在线观看| 久久99久国产精品黄毛片色诱| 麻豆精品视频在线观看免费 | 久久99九九99精品| 激情综合色综合久久| 国产麻豆成人传媒免费观看| 国产馆精品极品| 91欧美一区二区| 欧美调教femdomvk| 欧美一区二区三区视频| 日韩欧美国产精品| 久久综合九色综合97婷婷 | 日韩一区精品视频| 久久精品国产99国产| 国产成人午夜视频| 色综合久久久久久久久| 欧美性猛交xxxx黑人交| 91麻豆精品久久久久蜜臀| 精品久久久久99| 国产精品色一区二区三区| 亚洲欧美日韩一区| 视频一区二区不卡| 国产精品一区二区久激情瑜伽 | 欧美激情一区二区| 亚洲激情自拍偷拍| 青青草国产精品亚洲专区无| 国产在线一区二区| 91亚洲永久精品| 制服丝袜在线91| 欧美极品aⅴ影院| 亚洲国产精品麻豆| 精品无人区卡一卡二卡三乱码免费卡| 国产麻豆精品95视频| 在线视频欧美精品| 欧美不卡视频一区| 韩国av一区二区三区四区| 成人亚洲一区二区一| 欧美性一二三区| 久久久蜜桃精品| 亚洲一区二区三区在线播放| 久久电影网站中文字幕 | 国产三级欧美三级日产三级99| 亚洲欧洲av在线| 日本va欧美va瓶| 99久久99久久久精品齐齐| 欧美一级黄色片| 亚洲乱码中文字幕综合| 久久99国产精品久久| 91网站最新地址| 欧美精品一区二区三区蜜臀| 夜夜揉揉日日人人青青一国产精品 | 一区二区三区国产精华| 九一久久久久久| 欧美性极品少妇| 国产精品国产三级国产普通话三级 | 91精品中文字幕一区二区三区| 久久精品男人天堂av| 亚洲444eee在线观看| 成人黄色综合网站| 精品国产乱码91久久久久久网站| 亚洲精品免费在线| 丁香天五香天堂综合| 日韩一卡二卡三卡国产欧美| 亚洲女人的天堂| 国产精品99精品久久免费| 91精品国产综合久久久久久| 亚洲三级在线播放| 国产高清在线精品| 日韩欧美激情四射| 五月婷婷欧美视频| 色哟哟在线观看一区二区三区| 国产色婷婷亚洲99精品小说| 精品一区二区三区在线观看国产| 欧美三区在线观看| 亚洲美女免费在线| 99热精品国产| 亚洲欧洲三级电影| 成人av在线影院| 中文字幕免费观看一区| 狠狠色综合播放一区二区| 91精品一区二区三区在线观看| 亚洲一区二区综合| 色拍拍在线精品视频8848| 亚洲欧洲日韩女同| 成人激情小说网站| 国产精品视频你懂的| 高清久久久久久| 国产精品天干天干在线综合| 国产精品一区二区在线播放| 久久午夜色播影院免费高清| 精油按摩中文字幕久久| 欧美大尺度电影在线| 美女任你摸久久| 26uuu亚洲婷婷狠狠天堂| 麻豆专区一区二区三区四区五区| 亚洲欧美视频在线观看| 91影院在线观看| 亚洲欧美日韩成人高清在线一区| 99视频有精品| 一区二区三区日韩欧美精品| 色综合久久88色综合天天| 一区二区三区蜜桃| 欧美亚洲一区二区在线观看| 亚洲一区二区三区四区在线观看 | 精品久久久久久久人人人人传媒| 久草这里只有精品视频| 久久久午夜精品| 成人性生交大片免费看中文| 国产精品久久二区二区| 91啪亚洲精品| 午夜a成v人精品| 欧美电视剧免费全集观看| 国产乱人伦偷精品视频不卡| 国产精品久久久一本精品 | 欧美图区在线视频| 日韩专区欧美专区| 欧美精品一区二区三区久久久 | 国产三级三级三级精品8ⅰ区| 成人av资源网站| 亚洲综合av网| 日韩三级在线免费观看| 国产一区二区三区不卡在线观看| 国产农村妇女毛片精品久久麻豆| av成人动漫在线观看| 亚洲制服欧美中文字幕中文字幕| 91精品国产综合久久久久久久久久 | 国产不卡在线视频| 国产精品高潮呻吟久久| 欧美网站大全在线观看| 精品中文av资源站在线观看| 中文在线一区二区| 欧美亚洲综合网| 国内一区二区视频| 亚洲精品国产一区二区精华液| 欧美一区二区三区日韩| 成人午夜伦理影院| 五月激情六月综合| 国产三级欧美三级| 欧美三级电影在线看| 国产精品一区二区无线| 亚洲国产日韩一级| 久久精品欧美日韩| 精品视频全国免费看| 国产精品一区二区久激情瑜伽 | 成人av在线一区二区| 日韩影院免费视频| 国产精品免费aⅴ片在线观看| 欧美日韩激情一区| 国产成人精品亚洲日本在线桃色 | 国产乱妇无码大片在线观看| 亚洲综合激情网| 久久综合九色综合欧美就去吻 | 久久精品亚洲乱码伦伦中文 | 亚洲三级小视频| 精品国产一区二区在线观看| 91视频观看视频| 黄页网站大全一区二区| 亚洲成人激情自拍| 国产精品福利一区| 五月天亚洲精品| 国产精品国产自产拍高清av王其 | 亚洲国产一区视频| 日本一区二区久久| 日韩欧美国产一区在线观看| 欧美中文一区二区三区| 国产91精品一区二区麻豆亚洲| 日本在线播放一区二区三区| 亚洲欧美国产三级| 日本一二三四高清不卡| 日韩欧美中文字幕公布| 欧美视频在线不卡| av午夜一区麻豆| 成人深夜视频在线观看| 精品一区二区免费在线观看| 亚洲午夜免费电影| 亚洲男帅同性gay1069| 国产欧美一区二区精品仙草咪| 欧美大片一区二区| 91精品国产高清一区二区三区蜜臀 | 肉色丝袜一区二区| 亚洲男人都懂的| 亚洲素人一区二区| 国产精品美女久久久久aⅴ国产馆| 久久综合狠狠综合久久激情 | 蜜臀久久99精品久久久久久9| 亚洲午夜久久久久久久久久久 | 亚洲成av人片一区二区三区| 日韩理论在线观看| 国产精品国产馆在线真实露脸 | 激情欧美一区二区| 免费观看成人鲁鲁鲁鲁鲁视频| 亚洲v精品v日韩v欧美v专区|