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

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

?? pt.h

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? 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一区二区三区免费野_久草精品视频
国产精品1区2区| 人人精品人人爱| 欧美一区三区四区| 久久先锋影音av鲁色资源 | 亚洲成人免费av| 综合激情成人伊人| 精品久久久久久亚洲综合网| 色婷婷av久久久久久久| 风间由美中文字幕在线看视频国产欧美| 亚洲va国产va欧美va观看| 国产精品视频看| 中日韩免费视频中文字幕| 久久综合九色综合欧美亚洲| 日韩免费性生活视频播放| 日韩网站在线看片你懂的| 在线一区二区三区四区五区| 97国产一区二区| 粉嫩绯色av一区二区在线观看| 欧美日韩一区小说| 欧美私模裸体表演在线观看| 欧美视频在线观看一区| 欧美高清你懂得| 日韩一区二区三区免费看 | 精品捆绑美女sm三区| 欧美白人最猛性xxxxx69交| 欧美一级二级在线观看| 欧美电影免费观看高清完整版| 久久婷婷久久一区二区三区| 中文字幕第一区综合| 综合久久国产九一剧情麻豆| 亚洲午夜视频在线| 青青草91视频| 国产成人免费视频网站| 色婷婷综合久久| 日韩美女视频在线| 国产精品福利一区二区| 午夜视频一区二区三区| 国产91在线|亚洲| 日本道精品一区二区三区| 日韩欧美在线123| 一区二区久久久久久| 国产一区在线看| 欧美日韩午夜在线视频| 国产精品看片你懂得| 人人狠狠综合久久亚洲| 精品国产1区二区| 日韩激情视频网站| 91网站在线观看视频| 久久久不卡网国产精品一区| 亚洲电影你懂得| 91亚洲大成网污www| 国产日韩精品一区二区三区在线| 日本欧美大码aⅴ在线播放| 色哟哟一区二区| 亚洲欧美综合网| www.66久久| 中文字幕一区二区三区四区| 极品少妇xxxx精品少妇偷拍| 欧美日韩午夜精品| 午夜视频一区二区三区| 在线观看视频91| 亚洲图片欧美一区| 国内精品不卡在线| 亚洲欧洲制服丝袜| www.66久久| 丝袜亚洲另类欧美| 欧美mv日韩mv| 波波电影院一区二区三区| 一区二区三区小说| 国产99精品国产| 中文字幕乱码日本亚洲一区二区| 久久精品国产秦先生| 91精品国产一区二区三区| 日韩高清在线观看| 久久一区二区三区四区| 一区二区在线观看不卡| 99精品欧美一区二区三区综合在线| 欧美成人官网二区| 精品一区二区三区的国产在线播放 | 91视频国产资源| 国产精品网曝门| 91免费国产在线观看| 国产色综合久久| 日本韩国一区二区三区| 日韩国产精品91| 一区二区中文字幕在线| 欧美日韩成人综合| 成人精品视频一区二区三区| 亚洲精品久久嫩草网站秘色| 欧美另类z0zxhd电影| 狠狠色丁香九九婷婷综合五月| 国产精品青草综合久久久久99| 欧美日韩国产免费一区二区| 精品无人区卡一卡二卡三乱码免费卡 | 亚洲情趣在线观看| 久久亚洲综合av| 欧美一区二区三区免费视频 | 国产在线不卡一区| 亚洲一区二区综合| 最新国产の精品合集bt伙计| 中文字幕av一区 二区| 国产伦精品一区二区三区视频青涩| 在线不卡中文字幕| 欧美日韩国产成人在线91| 欧美精品丝袜久久久中文字幕| 欧美日韩小视频| 国产午夜精品在线观看| 亚洲国产成人午夜在线一区| 欧美成人一区二区三区在线观看 | 欧美无人高清视频在线观看| 国产成人精品免费在线| 国产在线播放一区三区四| 免费成人av在线播放| 亚洲成av人片一区二区| 亚洲最大色网站| 亚洲影视资源网| 午夜精品福利在线| 日本在线不卡一区| 国产一区二区三区蝌蚪| 国产成人在线视频网址| 成人av电影在线网| 91国偷自产一区二区三区观看| 欧美午夜精品一区二区蜜桃| 在线观看成人小视频| 欧美三级乱人伦电影| 日韩一卡二卡三卡四卡| 欧美疯狂性受xxxxx喷水图片| 91麻豆精品国产91久久久资源速度 | 日韩欧美成人激情| 久久久电影一区二区三区| 国产精品久久久久影院亚瑟| 亚洲综合久久久久| 日韩电影在线免费看| 久88久久88久久久| 韩国v欧美v亚洲v日本v| 99久久免费国产| 欧美精品色综合| 亚洲欧洲一区二区三区| 奇米综合一区二区三区精品视频| 国产一区二区0| 欧美麻豆精品久久久久久| 欧美国产综合色视频| 久久99精品国产| 日本韩国一区二区三区视频| 久久精品一区二区| 蜜臀91精品一区二区三区| 欧美午夜电影网| 亚洲黄色av一区| 在线视频综合导航| 又紧又大又爽精品一区二区| 99国产欧美另类久久久精品| 欧美国产精品专区| 成人动漫精品一区二区| 日本一区二区高清| 99久久婷婷国产| 亚洲精选一二三| 视频一区二区中文字幕| 狠狠色丁香婷婷综合| 91激情在线视频| 国产精品视频在线看| 精品一区二区影视| 欧美日韩国产一级| 亚洲视频小说图片| 国产suv一区二区三区88区| 日韩一区二区三区视频| 亚洲综合色在线| 97久久久精品综合88久久| 国产日韩欧美精品一区| 国产麻豆精品一区二区| 欧美电影免费观看高清完整版在线观看 | 久久久影视传媒| 免费不卡在线观看| 欧美一级日韩免费不卡| 免费在线视频一区| 欧美成人精品1314www| 日本不卡在线视频| 亚洲精品在线网站| 懂色av中文一区二区三区| 国产精品素人视频| 91亚洲国产成人精品一区二三 | 婷婷开心久久网| 9191久久久久久久久久久| 亚洲成a人片综合在线| 欧美精品日韩一本| 精品一区二区三区久久| 欧美高清在线一区| 日本伦理一区二区| 日本中文在线一区| 国产免费成人在线视频| 99re这里都是精品| 偷拍日韩校园综合在线| 欧美精品一区二区三区在线| 成人国产电影网| 亚洲va韩国va欧美va| 国产日韩v精品一区二区| 在线视频观看一区| 麻豆国产欧美日韩综合精品二区 | av电影在线观看不卡 | 天天做天天摸天天爽国产一区 | 国产成人啪午夜精品网站男同|