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

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

?? sys.c

?? 基于AT91SAM7x256的硬件平臺的WEB服務器源碼(A&shy DS版本, ucOS_II+LWIP+自己編寫的DNS查詢工具)
?? C
字號:
/* * Copyright (c) 2001-2004 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. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 lwIP TCP/IP stack. * * Author: Adam Dunkels <adam@sics.se> * */#include "lwip/sys.h"#include "lwip/opt.h"#include "lwip/def.h"#include "lwip/memp.h"#if (NO_SYS == 0)struct sswt_cb{    s16_t timeflag;    sys_sem_t *psem;};voidsys_mbox_fetch(sys_mbox_t mbox, void **msg){  u32_t time;  struct sys_timeouts *timeouts;  struct sys_timeout *tmptimeout;  sys_timeout_handler h;  void *arg; again:  timeouts = sys_arch_timeouts();  if (!timeouts || !timeouts->next) {    sys_arch_mbox_fetch(mbox, msg, 0);  } else {    if (timeouts->next->time > 0) {      time = sys_arch_mbox_fetch(mbox, msg, timeouts->next->time);    } else {      time = SYS_ARCH_TIMEOUT;    }    if (time == SYS_ARCH_TIMEOUT) {      /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message   could be fetched. We should now call the timeout handler and   deallocate the memory allocated for the timeout. */      tmptimeout = timeouts->next;      timeouts->next = tmptimeout->next;      h = tmptimeout->h;      arg = tmptimeout->arg;      memp_free(MEMP_SYS_TIMEOUT, tmptimeout);      if (h != NULL) {        LWIP_DEBUGF(SYS_DEBUG, ("smf calling h=%p(%p)\n", (void *)h, (void *)arg));      	h(arg);      }      /* We try again to fetch a message from the mbox. */      goto again;    } else {      /* If time != SYS_ARCH_TIMEOUT, a message was received before the timeout   occured. The time variable is set to the number of   milliseconds we waited for the message. */      if (time <= timeouts->next->time) {  timeouts->next->time -= time;      } else {  timeouts->next->time = 0;      }    }  }}voidsys_sem_wait(sys_sem_t sem){  u32_t time;  struct sys_timeouts *timeouts;  struct sys_timeout *tmptimeout;  sys_timeout_handler h;  void *arg;  /*  while (sys_arch_sem_wait(sem, 1000) == 0);      return;*/ again:  timeouts = sys_arch_timeouts();  if (!timeouts || !timeouts->next) {    sys_arch_sem_wait(sem, 0);  } else {    if (timeouts->next->time > 0) {      time = sys_arch_sem_wait(sem, timeouts->next->time);    } else {      time = SYS_ARCH_TIMEOUT;    }    if (time == SYS_ARCH_TIMEOUT) {      /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message   could be fetched. We should now call the timeout handler and   deallocate the memory allocated for the timeout. */      tmptimeout = timeouts->next;      timeouts->next = tmptimeout->next;      h = tmptimeout->h;      arg = tmptimeout->arg;      memp_free(MEMP_SYS_TIMEOUT, tmptimeout);      if (h != NULL) {        LWIP_DEBUGF(SYS_DEBUG, ("ssw h=%p(%p)\n", (void *)h, (void *)arg));        h(arg);      }      /* We try again to fetch a message from the mbox. */      goto again;    } else {      /* If time != SYS_ARCH_TIMEOUT, a message was received before the timeout   occured. The time variable is set to the number of   milliseconds we waited for the message. */      if (time <= timeouts->next->time) {  timeouts->next->time -= time;      } else {  timeouts->next->time = 0;      }    }  }}voidsys_timeout(u32_t msecs, sys_timeout_handler h, void *arg){  struct sys_timeouts *timeouts;  struct sys_timeout *timeout, *t;  timeout = memp_malloc(MEMP_SYS_TIMEOUT);  if (timeout == NULL) {    return;  }  timeout->next = NULL;  timeout->h = h;  timeout->arg = arg;  timeout->time = msecs;  timeouts = sys_arch_timeouts();  LWIP_DEBUGF(SYS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p\n",    (void *)timeout, msecs, (void *)h, (void *)arg));  LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL);  if (timeouts->next == NULL) {    timeouts->next = timeout;    return;  }  if (timeouts->next->time > msecs) {    timeouts->next->time -= msecs;    timeout->next = timeouts->next;    timeouts->next = timeout;  } else {    for(t = timeouts->next; t != NULL; t = t->next) {      timeout->time -= t->time;      if (t->next == NULL || t->next->time > timeout->time) {        if (t->next != NULL) {          t->next->time -= timeout->time;        }        timeout->next = t->next;        t->next = timeout;        break;      }    }  }}/* Go through timeout list (for this task only) and remove the first matching entry,   even though the timeout has not triggered yet.*/voidsys_untimeout(sys_timeout_handler h, void *arg){    struct sys_timeouts *timeouts;    struct sys_timeout *prev_t, *t;    timeouts = sys_arch_timeouts();    if (timeouts->next == NULL)        return;    for (t = timeouts->next, prev_t = NULL; t != NULL; prev_t = t, t = t->next)    {        if ((t->h == h) && (t->arg == arg))        {            /* We have a match */            /* Unlink from previous in list */            if (prev_t == NULL)                timeouts->next = t->next;            else                prev_t->next = t->next;            /* If not the last one, add time of this one back to next */            if (t->next != NULL)                t->next->time += t->time;            memp_free(MEMP_SYS_TIMEOUT, t);            return;        }    }    return;}static voidsswt_handler(void *arg){    struct sswt_cb *sswt_cb = (struct sswt_cb *) arg;    /* Timeout. Set flag to TRUE and signal semaphore */    sswt_cb->timeflag = 1;    sys_sem_signal(*(sswt_cb->psem));}/* Wait for a semaphore with timeout (specified in ms) *//* timeout = 0: wait forever *//* Returns 0 on timeout. 1 otherwise */intsys_sem_wait_timeout(sys_sem_t sem, u32_t timeout){    struct sswt_cb sswt_cb;    sswt_cb.psem = &sem;    sswt_cb.timeflag = 0;    /* If timeout is zero, then just wait forever */    if (timeout > 0)        /* Create a timer and pass it the address of our flag */        sys_timeout(timeout, sswt_handler, &sswt_cb);    sys_sem_wait(sem);    /* Was it a timeout? */    if (sswt_cb.timeflag)    {        /* timeout */        return 0;    } else {        /* Not a timeout. Remove timeout entry */        sys_untimeout(sswt_handler, &sswt_cb);        return 1;    }}voidsys_msleep(u32_t ms){  sys_sem_t delaysem = sys_sem_new(0);  sys_sem_wait_timeout(delaysem, ms);  sys_sem_free(delaysem);}#endif /* NO_SYS */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线|欧美| 亚洲欧美日韩国产成人精品影院| 欧美成人伊人久久综合网| 国产肉丝袜一区二区| 亚洲国产精品久久艾草纯爱| 欧美日韩国产一区二区三区地区| 国产亚洲人成网站| 亚洲精品菠萝久久久久久久| 日本在线播放一区二区三区| 92精品国产成人观看免费| 精品国产亚洲在线| 日韩黄色一级片| 亚洲va国产va欧美va观看| 国产欧美精品区一区二区三区| 精品女同一区二区| 亚洲欧洲制服丝袜| 亚洲日本护士毛茸茸| 日韩av一区二区在线影视| 日本电影欧美片| 国产精品国产三级国产| 大桥未久av一区二区三区中文| 26uuu国产一区二区三区| 日日夜夜免费精品| 色综合网色综合| 一区二区三区四区视频精品免费| 日韩不卡一二三区| 91官网在线免费观看| 最新国产の精品合集bt伙计| 国产一区三区三区| 日韩精品一区二区三区中文不卡| 亚洲高清三级视频| 一本大道久久a久久综合| 国产精品高潮久久久久无| 国产.欧美.日韩| 久久久精品人体av艺术| 国产自产高清不卡| 亚洲精品一区二区三区影院| 久久精品国产精品亚洲精品| 欧美一级日韩免费不卡| 日本sm残虐另类| 制服丝袜av成人在线看| 午夜影院在线观看欧美| 欧美午夜电影一区| 亚洲成年人网站在线观看| 欧美三级电影精品| 视频一区视频二区中文字幕| 欧美日韩国产123区| 五月综合激情日本mⅴ| 欧美精品日日鲁夜夜添| 日韩国产成人精品| 日韩免费一区二区| 久久福利资源站| 国产亚洲女人久久久久毛片| 大陆成人av片| 亚洲视频一区二区在线| 91精品1区2区| 五月天视频一区| 日韩欧美高清一区| 国产在线精品免费av| 国产午夜久久久久| 91丨九色丨蝌蚪富婆spa| 一区二区三区在线视频观看| 欧美日韩欧美一区二区| 蜜桃av噜噜一区二区三区小说| 欧美mv日韩mv亚洲| 成人一区二区视频| 亚洲美女免费视频| 欧美亚洲一区二区在线观看| 亚洲不卡在线观看| 精品卡一卡二卡三卡四在线| 成人性视频网站| 一区二区免费视频| 欧美一级理论性理论a| 久久66热偷产精品| 中文字幕在线不卡国产视频| 91搞黄在线观看| 青娱乐精品在线视频| 久久丝袜美腿综合| 色就色 综合激情| 蜜桃一区二区三区四区| 国产精品看片你懂得| 色哦色哦哦色天天综合| 图片区小说区区亚洲影院| 精品国产一区二区三区不卡| bt欧美亚洲午夜电影天堂| 亚洲一区二区三区在线看| 日韩一区二区三区四区五区六区| 国产成人免费在线视频| 一区二区三区在线视频播放 | 国产欧美日韩久久| 一道本成人在线| 免费看日韩a级影片| 中文字幕亚洲成人| 欧美一区二区三区在| 成人久久18免费网站麻豆| 日欧美一区二区| 中文字幕第一页久久| 亚洲一级电影视频| 久久日一线二线三线suv| 91论坛在线播放| 久草精品在线观看| 亚洲一区二区三区四区五区黄 | 欧美性大战xxxxx久久久| 久久国产人妖系列| 一区二区三区av电影 | 69堂国产成人免费视频| 国产不卡视频一区二区三区| 性做久久久久久免费观看| 久久精品人人做人人综合| 欧美浪妇xxxx高跟鞋交| 成人h动漫精品一区二区| 日韩av网站在线观看| 亚洲欧美乱综合| 26uuu亚洲婷婷狠狠天堂| 欧美视频三区在线播放| 国产69精品久久久久777| 麻豆传媒一区二区三区| 亚洲一区二区精品3399| 国产精品国产自产拍高清av王其| 日韩亚洲欧美高清| 欧美中文字幕久久| 成人免费av在线| 精品在线免费视频| 亚洲成人午夜影院| 亚洲黄色尤物视频| 国产精品国产三级国产有无不卡 | 日韩精品一区二区三区老鸭窝| 日本高清免费不卡视频| 国产成人精品1024| 久久国产欧美日韩精品| 亚洲不卡在线观看| 亚洲综合丁香婷婷六月香| 国产精品成人在线观看| 久久女同精品一区二区| 欧美va亚洲va在线观看蝴蝶网| 7777精品伊人久久久大香线蕉最新版| 色狠狠色噜噜噜综合网| 99久久综合色| 成人精品视频一区二区三区 | 日韩精品一二三区| 亚洲一区二区三区美女| 亚洲欧美日韩在线| 国产精品美女久久久久av爽李琼| 久久亚洲一级片| 精品少妇一区二区三区日产乱码| 91精品国产91热久久久做人人| 欧美视频一区二区三区四区| 91免费观看在线| 91在线视频在线| 99视频在线观看一区三区| 成人午夜免费电影| 成人激情小说乱人伦| 成人午夜碰碰视频| 成人a区在线观看| 成人av片在线观看| 成人动漫中文字幕| av资源网一区| 99精品视频中文字幕| av一区二区不卡| 99久久精品久久久久久清纯| 99精品黄色片免费大全| 91影视在线播放| 色妞www精品视频| 欧洲av在线精品| 欧美区在线观看| 日韩亚洲欧美成人一区| 精品国产制服丝袜高跟| wwww国产精品欧美| 国产无遮挡一区二区三区毛片日本| 国产区在线观看成人精品| 国产精品色哟哟网站| 亚洲欧洲无码一区二区三区| 综合色中文字幕| 一区二区三区中文字幕电影 | 亚洲综合一区二区三区| 亚洲国产三级在线| 亚洲午夜电影在线| 天堂av在线一区| 麻豆精品在线看| 国产成人av一区| 91片在线免费观看| 欧美日韩国产精选| 日韩欧美一级精品久久| 久久精品亚洲乱码伦伦中文| 国产精品久久久久久久久免费相片 | 99久久免费视频.com| 亚洲成av人片在线观看无码| 欧美电影一区二区| 99精品一区二区三区| 老司机免费视频一区二区| 综合久久一区二区三区| 日韩精品一区二区三区在线| 在线日韩一区二区| 日韩精品一区二区三区老鸭窝| 成人午夜短视频| 久久综合久久综合久久| 免费亚洲电影在线| 色综合激情五月| 91精品福利在线一区二区三区| 精品国产人成亚洲区|