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

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

?? death.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
字號:
/*
	FreeRTOS.org V4.1.1 - Copyright (C) 2003-2006 Richard Barry.

	This file is part of the FreeRTOS.org distribution.

	FreeRTOS.org is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	FreeRTOS.org is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with FreeRTOS.org; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

	A special exception to the GPL can be applied should you wish to distribute
	a combined work that includes FreeRTOS.org, without being obliged to provide
	the source code for any proprietary components.  See the licensing section 
	of http://www.FreeRTOS.org for full details of how and when the exception
	can be applied.

	***************************************************************************
	See http://www.FreeRTOS.org for documentation, latest information, license 
	and contact details.  Please ensure to read the configuration and relevant 
	port sections of the online documentation.
	***************************************************************************
*/

/**
 * Create a single persistent task which periodically dynamically creates another 
 * four tasks.  The original task is called the creator task, the four tasks it 
 * creates are called suicidal tasks.
 *
 * Two of the created suicidal tasks kill one other suicidal task before killing 
 * themselves - leaving just the original task remaining.  
 *
 * The creator task must be spawned after all of the other demo application tasks 
 * as it keeps a check on the number of tasks under the scheduler control.  The 
 * number of tasks it expects to see running should never be greater than the 
 * number of tasks that were in existence when the creator task was spawned, plus 
 * one set of four suicidal tasks.  If this number is exceeded an error is flagged.
 *
 * \page DeathC death.c
 * \ingroup DemoFiles
 * <HR>
 */

/*
Changes from V2.0.0

	+ Delay periods are now specified using variables and constants of
	  portTickType rather than unsigned portLONG.
*/

#include <stdlib.h>

/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"

/* Demo program include files. */
#include "death.h"
#include "print.h"

#define deathSTACK_SIZE		( ( unsigned portSHORT ) 512 )

/* The task originally created which is responsible for periodically dynamically 
creating another four tasks. */
static void vCreateTasks( void *pvParameters );

/* The task function of the dynamically created tasks. */
static void vSuicidalTask( void *pvParameters );

/* A variable which is incremented every time the dynamic tasks are created.  This 
is used to check that the task is still running. */
static volatile portSHORT sCreationCount = 0;

/* Used to store the number of tasks that were originally running so the creator 
task can tell if any of the suicidal tasks have failed to die. */
static volatile unsigned portBASE_TYPE uxTasksRunningAtStart = 0;
static const unsigned portBASE_TYPE uxMaxNumberOfExtraTasksRunning = 5;

/* Used to store a handle to the tasks that should be killed by a suicidal task, 
before it kills itself. */
xTaskHandle xCreatedTask1, xCreatedTask2;

/*-----------------------------------------------------------*/

void vCreateSuicidalTasks( unsigned portBASE_TYPE uxPriority )
{
unsigned portBASE_TYPE *puxPriority;

	/* Create the Creator tasks - passing in as a parameter the priority at which 
	the suicidal tasks should be created. */
	puxPriority = ( unsigned portBASE_TYPE * ) pvPortMalloc( sizeof( unsigned portBASE_TYPE ) );
	*puxPriority = uxPriority;

	xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );

	/* Record the number of tasks that are running now so we know if any of the 
	suicidal tasks have failed to be killed. */
	uxTasksRunningAtStart = uxTaskGetNumberOfTasks();
}
/*-----------------------------------------------------------*/

static void vSuicidalTask( void *pvParameters )
{
portDOUBLE d1, d2;
xTaskHandle xTaskToKill;
const portTickType xDelay = ( portTickType ) 500 / portTICK_RATE_MS;

	if( pvParameters != NULL )
	{
		/* This task is periodically created four times.  Tow created tasks are 
		passed a handle to the other task so it can kill it before killing itself.  
		The other task is passed in null. */
		xTaskToKill = *( xTaskHandle* )pvParameters;
	}
	else
	{
		xTaskToKill = NULL;
	}

	for( ;; )
	{
		/* Do something random just to use some stack and registers. */
		d1 = 2.4;
		d2 = 89.2;
		d2 *= d1;
		vTaskDelay( xDelay );

		if( xTaskToKill != NULL )
		{
			/* Make sure the other task has a go before we delete it. */
			vTaskDelay( ( portTickType ) 0 );
			/* Kill the other task that was created by vCreateTasks(). */
			vTaskDelete( xTaskToKill );
			/* Kill ourselves. */
			vTaskDelete( NULL );
		}
	}
}/*lint !e818 !e550 Function prototype must be as per standard for task functions. */
/*-----------------------------------------------------------*/

static void vCreateTasks( void *pvParameters )
{
const portTickType xDelay = ( portTickType ) 1000 / portTICK_RATE_MS;
unsigned portBASE_TYPE uxPriority;
const portCHAR * const pcTaskStartMsg = "Create task started.\r\n";

	/* Queue a message for printing to say the task has started. */
	vPrintDisplayMessage( &pcTaskStartMsg );

	uxPriority = *( unsigned portBASE_TYPE * ) pvParameters;
	vPortFree( pvParameters );

	for( ;; )
	{
		/* Just loop round, delaying then creating the four suicidal tasks. */
		vTaskDelay( xDelay );

		xTaskCreate( vSuicidalTask, "SUICIDE1", deathSTACK_SIZE, NULL, uxPriority, &xCreatedTask1 );
		xTaskCreate( vSuicidalTask, "SUICIDE2", deathSTACK_SIZE, &xCreatedTask1, uxPriority, NULL );

		xTaskCreate( vSuicidalTask, "SUICIDE1", deathSTACK_SIZE, NULL, uxPriority, &xCreatedTask2 );
		xTaskCreate( vSuicidalTask, "SUICIDE2", deathSTACK_SIZE, &xCreatedTask2, uxPriority, NULL );

		++sCreationCount;
	}
}
/*-----------------------------------------------------------*/

/* This is called to check that the creator task is still running and that there 
are not any more than four extra tasks. */
portBASE_TYPE xIsCreateTaskStillRunning( void )
{
static portSHORT sLastCreationCount = 0;
portSHORT sReturn = pdTRUE;
unsigned portBASE_TYPE uxTasksRunningNow;

	if( sLastCreationCount == sCreationCount )
	{
		sReturn = pdFALSE;
	}
	
	uxTasksRunningNow = uxTaskGetNumberOfTasks();

	if( uxTasksRunningNow < uxTasksRunningAtStart )
	{
		sReturn = pdFALSE;
	}
	else if( ( uxTasksRunningNow - uxTasksRunningAtStart ) > uxMaxNumberOfExtraTasksRunning )
	{
		sReturn = pdFALSE;
	}
	else
	{
		/* Everything is okay. */
	}

	return sReturn;
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲同性同志一二三专区| 国产成人免费9x9x人网站视频| 奇米色777欧美一区二区| 不卡一区二区在线| 日韩欧美一区中文| 最新中文字幕一区二区三区| 蜜桃精品视频在线| 色综合久久中文综合久久牛| 精品国产免费久久| 性做久久久久久| 91在线视频播放| 欧美tk—视频vk| 日韩电影一区二区三区四区| 99视频精品全部免费在线| 久久亚洲一区二区三区四区| 日韩二区三区在线观看| 欧美性淫爽ww久久久久无| 日韩理论在线观看| 国产精品一区一区三区| 欧美变态凌虐bdsm| 一区二区视频在线| 成av人片一区二区| 国产精品视频看| 国产69精品一区二区亚洲孕妇| 91精品国产综合久久精品图片| 亚洲精品精品亚洲| av中文字幕在线不卡| 国产拍欧美日韩视频二区| 国产一区二三区好的| 欧美不卡一区二区三区| 看电视剧不卡顿的网站| 制服.丝袜.亚洲.中文.综合| 亚洲在线观看免费| 欧美自拍偷拍一区| 亚洲一区二区在线观看视频 | 久久网站热最新地址| 奇米综合一区二区三区精品视频| 91麻豆精品国产91久久久更新时间 | 欧美在线制服丝袜| 中文字幕一区二区三| 91色九色蝌蚪| 亚洲激情图片一区| 欧美日本不卡视频| 日韩专区在线视频| 日韩欧美激情四射| 国产精品一区在线观看乱码| 国产精品色噜噜| 色综合视频一区二区三区高清| 亚洲精品国产精品乱码不99| 在线观看不卡一区| 免费观看在线色综合| 国产亚洲精品久| 色婷婷av一区二区三区gif| 亚洲成人激情av| 欧美mv和日韩mv国产网站| 风间由美一区二区三区在线观看| 亚洲婷婷综合久久一本伊一区| 欧美影院一区二区三区| 精品一区二区三区在线播放| 国产女主播一区| 欧美日韩精品一区二区三区四区| 精彩视频一区二区| 中文字幕中文字幕在线一区 | 久久久久久久久久久黄色| 波波电影院一区二区三区| 亚洲国产精品一区二区久久恐怖片 | 在线成人高清不卡| 国产一区在线看| 一区二区在线看| 久久综合久久鬼色| 欧美自拍偷拍一区| 国产乱子伦一区二区三区国色天香| 国产精品久久免费看| 欧美老肥妇做.爰bbww| 国产盗摄一区二区| 视频一区中文字幕| 国产精品久久久久毛片软件| 日韩一区二区在线观看视频播放| 国产suv精品一区二区三区| 日韩中文字幕亚洲一区二区va在线| 久久久91精品国产一区二区三区| 欧美视频中文字幕| 99视频一区二区| 国内精品在线播放| 三级在线观看一区二区| 国产精品日产欧美久久久久| 日韩亚洲欧美综合| 欧美日韩和欧美的一区二区| 成人av网站在线观看免费| 免费欧美在线视频| 亚洲国产精品久久人人爱| 国产精品嫩草久久久久| 精品国产一区二区亚洲人成毛片| 欧美日韩亚洲不卡| 色94色欧美sute亚洲13| 国产成人综合亚洲91猫咪| 久久精品国产精品青草| 午夜视频久久久久久| 亚洲免费伊人电影| 中文字幕一区二区三区色视频| www一区二区| 日韩欧美国产综合一区| 欧美丰满美乳xxx高潮www| 欧洲人成人精品| 在线免费观看日本欧美| 97精品电影院| 色综合久久久久网| 一本色道久久综合亚洲aⅴ蜜桃| 不卡一卡二卡三乱码免费网站| 精品一区二区久久| 九九**精品视频免费播放| 蜜桃av一区二区三区电影| 日本午夜精品一区二区三区电影 | 国产精品家庭影院| 亚洲欧洲精品一区二区三区不卡| 国产视频在线观看一区二区三区| 精品国产sm最大网站免费看| 欧美电影免费观看高清完整版在线 | 欧美videossexotv100| 日韩欧美精品在线视频| 精品国产免费久久| 久久精品日产第一区二区三区高清版 | 欧美体内she精高潮| 在线精品观看国产| 欧美日韩激情一区二区三区| 制服丝袜中文字幕亚洲| 日韩欧美中文字幕制服| 久久久久久久久伊人| 国产精品人妖ts系列视频| 亚洲女同女同女同女同女同69| 亚洲综合丁香婷婷六月香| 午夜视频在线观看一区二区| 免费看欧美女人艹b| 国产一区在线观看视频| 成人午夜激情片| 欧美在线999| 精品久久久久久无| 中文字幕在线不卡视频| 亚洲成av人**亚洲成av**| 美女视频网站久久| 丰满少妇久久久久久久| 色琪琪一区二区三区亚洲区| 91精品中文字幕一区二区三区| 欧美xxxxx裸体时装秀| 国产精品毛片大码女人| 亚洲高清免费视频| 激情偷乱视频一区二区三区| 成人av影院在线| 制服.丝袜.亚洲.中文.综合| 国产欧美日韩三级| 亚洲香肠在线观看| 极品美女销魂一区二区三区| 91首页免费视频| 日韩一区二区在线观看| 国产精品久久久久久久久快鸭| 亚洲成av人片| 丁香婷婷综合色啪| 91精品视频网| 亚洲品质自拍视频| 久久av资源站| 欧美探花视频资源| 国产精品乱码久久久久久| 奇米一区二区三区av| 9l国产精品久久久久麻豆| 日韩三级电影网址| 亚洲一区二区精品久久av| 国产a区久久久| 日韩欧美成人一区| 亚洲一区二区三区国产| 成人精品鲁一区一区二区| 日韩欧美你懂的| 午夜国产精品一区| k8久久久一区二区三区| 精品国产1区二区| 日本在线播放一区二区三区| 一本大道久久精品懂色aⅴ| 国产亚洲一区二区三区在线观看| 免费在线观看一区| 欧美日韩激情一区二区| 亚洲素人一区二区| 成人黄色国产精品网站大全在线免费观看 | 在线亚洲免费视频| 中文字幕免费一区| 国产一区二区日韩精品| 欧美不卡123| 乱中年女人伦av一区二区| 欧美性生活久久| 一区二区三区四区在线播放| 不卡的电影网站| 中文字幕第一区| 蜜桃久久av一区| 日韩欧美中文字幕精品| 麻豆91在线看| 日韩欧美国产一二三区| 日本网站在线观看一区二区三区| 欧美日韩大陆在线| 日韩激情在线观看| 91精品国产乱| 另类综合日韩欧美亚洲| 日韩精品一区国产麻豆|