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

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

?? pt.h

?? freescale k40/k60 freertos-uip 例程
?? H
字號:
/*
 * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the Institute nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * This file is part of the uIP TCP/IP stack
 *
 * Author: Adam Dunkels <adam@sics.se>
 *
 * $Id: pt.h,v 1.2 2006/06/12 08:00:30 adam Exp $
 */

/**
 * \addtogroup pt
 * @{
 */

/**
 * \file
 * Protothreads implementation.
 * \author
 * Adam Dunkels <adam@sics.se>
 *
 */

#ifndef __PT_H__
#define __PT_H__

#include "lc.h"

struct pt {
  lc_t lc;
};

#define PT_WAITING 0
#define PT_EXITED  1
#define PT_ENDED   2
#define PT_YIELDED 3

/**
 * \name Initialization
 * @{
 */

/**
 * Initialize a protothread.
 *
 * Initializes a protothread. Initialization must be done prior to
 * starting to execute the protothread.
 *
 * \param pt A pointer to the protothread control structure.
 *
 * \sa PT_SPAWN()
 *
 * \hideinitializer
 */
#define PT_INIT(pt)   LC_INIT((pt)->lc)

/** @} */

/**
 * \name Declaration and definition
 * @{
 */

/**
 * Declaration of a protothread.
 *
 * This macro is used to declare a protothread. All protothreads must
 * be declared with this macro.
 *
 * \param name_args The name and arguments of the C function
 * implementing the protothread.
 *
 * \hideinitializer
 */
#define PT_THREAD(name_args) char name_args

/**
 * Declare the start of a protothread inside the C function
 * implementing the protothread.
 *
 * This macro is used to declare the starting point of a
 * protothread. It should be placed at the start of the function in
 * which the protothread runs. All C statements above the PT_BEGIN()
 * invokation will be executed each time the protothread is scheduled.
 *
 * \param pt A pointer to the protothread control structure.
 *
 * \hideinitializer
 */
#define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc)

/**
 * Declare the end of a protothread.
 *
 * This macro is used for declaring that a protothread ends. It must
 * always be used together with a matching PT_BEGIN() macro.
 *
 * \param pt A pointer to the protothread control structure.
 *
 * \hideinitializer
 */
#define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \
                   PT_INIT(pt); return PT_ENDED; }

/** @} */

/**
 * \name Blocked wait
 * @{
 */

/**
 * Block and wait until condition is true.
 *
 * This macro blocks the protothread until the specified condition is
 * true.
 *
 * \param pt A pointer to the protothread control structure.
 * \param condition The condition.
 *
 * \hideinitializer
 */
#define PT_WAIT_UNTIL(pt, condition)	        \
  do {						\
    LC_SET((pt)->lc);				\
    if(!(condition)) {				\
      return PT_WAITING;			\
    }						\
  } while(0)

/**
 * Block and wait while condition is true.
 *
 * This function blocks and waits while condition is true. See
 * PT_WAIT_UNTIL().
 *
 * \param pt A pointer to the protothread control structure.
 * \param cond The condition.
 *
 * \hideinitializer
 */
#define PT_WAIT_WHILE(pt, cond)  PT_WAIT_UNTIL((pt), !(cond))

/** @} */

/**
 * \name Hierarchical protothreads
 * @{
 */

/**
 * Block and wait until a child protothread completes.
 *
 * This macro schedules a child protothread. The current protothread
 * will block until the child protothread completes.
 *
 * \note The child protothread must be manually initialized with the
 * PT_INIT() function before this function is used.
 *
 * \param pt A pointer to the protothread control structure.
 * \param thread The child protothread with arguments
 *
 * \sa PT_SPAWN()
 *
 * \hideinitializer
 */
#define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread))

/**
 * Spawn a child protothread and wait until it exits.
 *
 * This macro spawns a child protothread and waits until it exits. The
 * macro can only be used within a protothread.
 *
 * \param pt A pointer to the protothread control structure.
 * \param child A pointer to the child protothread's control structure.
 * \param thread The child protothread with arguments
 *
 * \hideinitializer
 */
#define PT_SPAWN(pt, child, thread)		\
  do {						\
    PT_INIT((child));				\
    PT_WAIT_THREAD((pt), (thread));		\
  } while(0)

/** @} */

/**
 * \name Exiting and restarting
 * @{
 */

/**
 * Restart the protothread.
 *
 * This macro will block and cause the running protothread to restart
 * its execution at the place of the PT_BEGIN() call.
 *
 * \param pt A pointer to the protothread control structure.
 *
 * \hideinitializer
 */
#define PT_RESTART(pt)				\
  do {						\
    PT_INIT(pt);				\
    return PT_WAITING;			\
  } while(0)

/**
 * Exit the protothread.
 *
 * This macro causes the protothread to exit. If the protothread was
 * spawned by another protothread, the parent protothread will become
 * unblocked and can continue to run.
 *
 * \param pt A pointer to the protothread control structure.
 *
 * \hideinitializer
 */
#define PT_EXIT(pt)				\
  do {						\
    PT_INIT(pt);				\
    return PT_EXITED;			\
  } while(0)

/** @} */

/**
 * \name Calling a protothread
 * @{
 */

/**
 * Schedule a protothread.
 *
 * This function shedules a protothread. The return value of the
 * function is non-zero if the protothread is running or zero if the
 * protothread has exited.
 *
 * \param f The call to the C function implementing the protothread to
 * be scheduled
 *
 * \hideinitializer
 */
#define PT_SCHEDULE(f) ((f) == PT_WAITING)

/** @} */

/**
 * \name Yielding from a protothread
 * @{
 */

/**
 * Yield from the current protothread.
 *
 * This function will yield the protothread, thereby allowing other
 * processing to take place in the system.
 *
 * \param pt A pointer to the protothread control structure.
 *
 * \hideinitializer
 */
#define PT_YIELD(pt)				\
  do {						\
    PT_YIELD_FLAG = 0;				\
    LC_SET((pt)->lc);				\
    if(PT_YIELD_FLAG == 0) {			\
      return PT_YIELDED;			\
    }						\
  } while(0)

/**
 * \brief      Yield from the protothread until a condition occurs.
 * \param pt   A pointer to the protothread control structure.
 * \param cond The condition.
 *
 *             This function will yield the protothread, until the
 *             specified condition evaluates to true.
 *
 *
 * \hideinitializer
 */
#define PT_YIELD_UNTIL(pt, cond)		\
  do {						\
    PT_YIELD_FLAG = 0;				\
    LC_SET((pt)->lc);				\
    if((PT_YIELD_FLAG == 0) || !(cond)) {	\
      return PT_YIELDED;			\
    }						\
  } while(0)

/** @} */

#endif /* __PT_H__ */

/** @} */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本韩国精品在线| 国产精品无码永久免费888| 777午夜精品视频在线播放| 精品捆绑美女sm三区| 国产精品久久久久影院色老大| 亚洲成精国产精品女| 丁香天五香天堂综合| 欧美一区二区播放| 亚洲人成在线观看一区二区| 国产在线国偷精品免费看| 欧美午夜电影在线播放| 国产精品久久看| 老色鬼精品视频在线观看播放| 91免费看片在线观看| 国产情人综合久久777777| 免费一区二区视频| 欧美日韩高清影院| 亚洲人妖av一区二区| 国产激情精品久久久第一区二区 | 精品一区二区三区不卡 | 欧美精品久久久久久久多人混战 | 成人福利视频网站| 欧美三级中文字幕在线观看| 国产精品国产三级国产三级人妇 | 欧美成人性战久久| 亚洲一区欧美一区| 91女厕偷拍女厕偷拍高清| 国产精品乱码一区二区三区软件 | 精品国精品自拍自在线| 日韩av在线免费观看不卡| 在线精品视频一区二区三四| 最近中文字幕一区二区三区| 成人免费看视频| 国产亚洲综合性久久久影院| 国产麻豆精品在线观看| www精品美女久久久tv| 狠狠色丁香久久婷婷综| 精品久久久久一区| 激情成人午夜视频| 久久久国产综合精品女国产盗摄| 久久99精品一区二区三区 | 婷婷国产在线综合| 欧美日韩一级二级| 免费看欧美女人艹b| 精品久久免费看| 国产老肥熟一区二区三区| 国产欧美一区二区在线| 丁香天五香天堂综合| 国产精品欧美经典| 在线观看欧美黄色| 五月婷婷综合激情| 精品剧情v国产在线观看在线| 国产乱妇无码大片在线观看| 国产精品情趣视频| 91国产视频在线观看| 日韩精品五月天| 精品国产一区二区三区不卡| 国产成人精品免费| 亚洲视频1区2区| 欧美精品丝袜中出| 国产综合一区二区| 亚洲视频在线一区| 欧美一级在线免费| 国产成人在线网站| 亚洲午夜三级在线| 精品第一国产综合精品aⅴ| 国产不卡一区视频| 亚洲国产乱码最新视频 | 精品成人一区二区三区四区| 国产激情精品久久久第一区二区| 亚洲品质自拍视频| 日韩欧美黄色影院| 97国产精品videossex| 日韩激情视频网站| 中文字幕亚洲一区二区va在线| 欧美在线观看视频一区二区| 狠狠色丁香久久婷婷综| 一区二区三区四区高清精品免费观看| 欧美日韩二区三区| 成人av资源在线| 捆绑调教一区二区三区| 亚洲欧美综合色| 精品国产一区久久| 欧美体内she精视频| 大陆成人av片| 免费不卡在线视频| 亚洲黄色小说网站| 中文字幕巨乱亚洲| 欧美大片在线观看一区| 一本久久精品一区二区| 国产精品亚洲人在线观看| 午夜精品免费在线观看| 日韩理论片一区二区| 欧美精品一区二| 8x8x8国产精品| 在线观看日韩高清av| 粉嫩绯色av一区二区在线观看| 青青草伊人久久| 一卡二卡三卡日韩欧美| 国产精品日韩成人| 久久久亚洲高清| 日韩久久免费av| 91精品国产综合久久久久久久久久| www.av亚洲| 成人黄色片在线观看| 国产精品香蕉一区二区三区| 另类综合日韩欧美亚洲| 香蕉加勒比综合久久| 亚洲综合视频网| 亚洲人成网站精品片在线观看| 中文字幕第一区二区| 国产拍揄自揄精品视频麻豆| 精品国产一区二区三区av性色| 日韩一级免费观看| 日韩午夜激情视频| 欧美一区二区三区白人| 日韩欧美一级片| 欧美成人免费网站| 日韩精品在线看片z| 欧美大片免费久久精品三p| 欧美一区二区三区婷婷月色| 正在播放一区二区| 欧美成人女星排行榜| 精品国产区一区| 久久久久国产精品麻豆ai换脸| 久久久精品2019中文字幕之3| 久久九九99视频| 中文字幕乱码久久午夜不卡 | 成人妖精视频yjsp地址| 成人爱爱电影网址| 欧洲精品一区二区| 欧美日韩国产乱码电影| 日韩一区二区免费高清| 欧美精品一区二区久久婷婷| 久久精品男人天堂av| 亚洲欧美一区二区视频| 亚洲伊人色欲综合网| 毛片一区二区三区| 国产91富婆露脸刺激对白| eeuss国产一区二区三区| 日本高清成人免费播放| 91精品国产乱码| 久久久久久久久一| 亚洲视频在线一区二区| 丝袜诱惑制服诱惑色一区在线观看 | 亚洲精品在线免费播放| 国产精品久久久久影院亚瑟| 亚洲高清久久久| 国内精品在线播放| 99久久99久久精品免费观看| 欧美老肥妇做.爰bbww| 久久综合九色综合97_久久久| 中文字幕一区二区三区av| 天天影视网天天综合色在线播放| 韩国精品在线观看| 色婷婷综合久久| 欧美精品一区二区高清在线观看| 亚洲日本在线天堂| 久久国内精品视频| 北条麻妃一区二区三区| 中文字幕日韩一区| 丝袜诱惑制服诱惑色一区在线观看| 国产精品原创巨作av| 欧亚洲嫩模精品一区三区| 精品国产乱码久久久久久牛牛| 136国产福利精品导航| 免费一级欧美片在线观看| 成人国产精品免费网站| 日韩午夜激情视频| 亚洲一区二区三区四区在线| 国产一区二区三区精品欧美日韩一区二区三区 | 日韩一区二区三区在线视频| 亚洲欧美成人一区二区三区| 美女精品自拍一二三四| 色999日韩国产欧美一区二区| 久久先锋影音av鲁色资源网| 一区二区三区国产| 懂色av一区二区三区蜜臀| 欧美一区二区美女| 亚洲欧美视频在线观看视频| 国产在线播放一区二区三区| 欧美精品高清视频| 亚洲精品国产视频| 成人免费视频视频在线观看免费| 欧美大片拔萝卜| 午夜精品影院在线观看| 91日韩精品一区| 国产精品美女视频| 国产裸体歌舞团一区二区| 91麻豆精品国产91久久久久久| 亚洲激情中文1区| 99r国产精品| 日本一区二区成人在线| 国产在线精品一区二区| 欧美大片顶级少妇| 久久精品国产亚洲高清剧情介绍 | 久久综合色8888| 另类中文字幕网| 91精品国产美女浴室洗澡无遮挡| 五月婷婷综合网|