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

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

?? pt.h

?? 最新版FreeRTOS, 包擴(kuò)多種開發(fā)平臺的移植
?? 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__ */

/** @} */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人自拍视频在线| 亚洲色图一区二区三区| 日本一区二区视频在线观看| 一区二区中文字幕在线| 亚洲 欧美综合在线网络| 麻豆精品视频在线观看免费| 国产成人精品三级| 欧美午夜免费电影| 久久久国际精品| 一区二区三区影院| 九色porny丨国产精品| 成人美女在线视频| 91精品欧美综合在线观看最新| 2024国产精品| 亚洲综合视频在线观看| 国产乱妇无码大片在线观看| 日本高清不卡在线观看| 欧美一二三在线| 亚洲欧美精品午睡沙发| 久久不见久久见免费视频7| 成人黄色在线看| 在线不卡一区二区| 中文久久乱码一区二区| 五月婷婷综合网| 不卡的av电影在线观看| 日韩一区二区在线看| 亚洲欧美日韩电影| 国产一区二区三区综合| 欧美日韩在线三级| 国产精品素人视频| 蜜臀av性久久久久av蜜臀妖精| 97aⅴ精品视频一二三区| 欧美电视剧免费全集观看| 亚洲精品大片www| 国产成人亚洲精品青草天美| 欧美年轻男男videosbes| 国产精品美女久久久久久久网站| 老司机免费视频一区二区三区| 91黄色激情网站| 久久精品无码一区二区三区| 偷拍亚洲欧洲综合| 97精品久久久久中文字幕| 欧美精品一区视频| 日本美女一区二区三区| 欧美在线小视频| 亚洲欧洲国产专区| 国产成人精品免费一区二区| 欧美电视剧在线观看完整版| 日韩精品高清不卡| 欧美日韩一区高清| 一级日本不卡的影视| 92国产精品观看| 国产精品无码永久免费888| 国内成人自拍视频| 91精品一区二区三区久久久久久| 亚洲午夜在线视频| 色婷婷av久久久久久久| 国产精品麻豆一区二区 | 欧美日韩成人一区二区| 亚洲视频图片小说| jizzjizzjizz欧美| 欧美高清在线精品一区| 国产美女精品在线| 久久九九久久九九| 国产激情视频一区二区三区欧美| 精品理论电影在线观看| 久久av老司机精品网站导航| 日韩女优制服丝袜电影| 久久超碰97中文字幕| 欧美大尺度电影在线| 麻豆91精品91久久久的内涵| 欧美一区二区三区啪啪| 日韩不卡手机在线v区| 8x8x8国产精品| 美女免费视频一区二区| 日韩精品一区二区三区中文不卡 | 精品88久久久久88久久久| 午夜精品福利在线| 7777精品伊人久久久大香线蕉完整版 | 精品一区二区三区av| 精品国产sm最大网站免费看| 韩国欧美国产1区| 国产欧美日韩精品在线| 成人免费视频国产在线观看| 亚洲少妇最新在线视频| 欧美三片在线视频观看| 天天亚洲美女在线视频| 精品少妇一区二区三区| 国产suv精品一区二区883| 国产精品久久99| 日本二三区不卡| 亚欧色一区w666天堂| 欧美日韩国产一区二区三区地区| 爽好多水快深点欧美视频| 日韩一卡二卡三卡四卡| 国产精品123| 国产精品短视频| 欧美性色黄大片手机版| 日韩电影在线观看网站| 久久免费的精品国产v∧| www.色精品| 亚洲国产人成综合网站| 精品毛片乱码1区2区3区| 成人理论电影网| 亚洲不卡av一区二区三区| 91精品麻豆日日躁夜夜躁| 国产精品996| 亚洲一区二区综合| 日韩免费观看2025年上映的电影| 成人永久aaa| 亚洲国产人成综合网站| 久久久久久麻豆| 欧美亚洲图片小说| 精品一区中文字幕| 1024国产精品| 91麻豆精品国产91久久久| 国产夫妻精品视频| 一区二区理论电影在线观看| 精品国产乱码久久久久久蜜臀| www.亚洲激情.com| 免费在线观看不卡| 日韩码欧中文字| 日韩美一区二区三区| 99精品国产99久久久久久白柏 | 欧美一区二区黄| www.欧美.com| 免费观看一级欧美片| 一区在线观看视频| 日韩一级完整毛片| 色婷婷综合久久久久中文一区二区 | 成人精品一区二区三区四区 | 精品国产乱码久久| 色综合色综合色综合色综合色综合 | 一本一道久久a久久精品综合蜜臀| 理论电影国产精品| 夜夜揉揉日日人人青青一国产精品| 日韩一区二区视频| 欧美亚洲综合色| 成人国产电影网| 精品亚洲成a人在线观看| 亚洲图片欧美色图| 国产精品人妖ts系列视频| 欧美成人伊人久久综合网| 欧美日韩一区二区三区四区| 成人一区在线看| 看国产成人h片视频| 亚洲一二三专区| 亚洲欧洲www| 国产欧美日韩在线| 欧美岛国在线观看| 欧美日韩你懂的| 一道本成人在线| eeuss鲁片一区二区三区在线观看| 国产综合久久久久影院| 日本亚洲免费观看| 亚洲丶国产丶欧美一区二区三区| 亚洲欧洲日本在线| 国产精品免费视频网站| 久久久久国产精品麻豆ai换脸 | 粉嫩av一区二区三区| 美国三级日本三级久久99| 婷婷国产v国产偷v亚洲高清| 一区二区三区小说| 亚洲视频一区二区在线观看| 中文一区一区三区高中清不卡| 亚洲精品一区二区三区蜜桃下载 | 国产成人精品影视| 国内精品久久久久影院色| 日本人妖一区二区| 亚洲成人动漫在线免费观看| 亚洲精品第一国产综合野| 亚洲欧美日韩国产成人精品影院| 国产精品女上位| 国产人妖乱国产精品人妖| 久久久久一区二区三区四区| 精品区一区二区| 欧美电影免费观看完整版| 日韩精品影音先锋| 欧美成人a在线| 日韩免费一区二区| 精品国产乱码久久久久久1区2区 | 成人国产精品视频| av动漫一区二区| 99久精品国产| 色综合色综合色综合色综合色综合| 91丨porny丨蝌蚪视频| 99久久精品国产导航| 色婷婷一区二区| 欧美性生交片4| 8x8x8国产精品| 精品卡一卡二卡三卡四在线| 精品国产亚洲一区二区三区在线观看| 日韩欧美一区二区三区在线| 精品国产乱码久久| 久久久国产午夜精品| 国产精品久久久久久久久动漫| 亚洲视频在线观看一区| 亚洲成人av一区二区| 免费看日韩精品| 国产精品自在欧美一区|