⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 atdelctx.c

📁 T-kernel 的extension源代码
💻 C
字号:
/* *---------------------------------------------------------------------- *    T-Kernel / Standard Extension * *    Copyright (C) 2006 by Ken Sakamura. All rights reserved. *    T-Kernel / Standard Extension is distributed  *      under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * *    Version:   1.00.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* *	atdelctx.c (libtkse) * *	Discard the task context * *	The processing within library when task context is unnecessary  *      such as the task exit time, etc. */#include <tk/tkernel.h>#include <sys/libs.h>LOCAL void atdelctx_exec( ID tskid );IMPORT FP __atdelctx_entry;	/* delctx.c */#define	NENT	8#define TSD_ADC_RTN_M1	(-1)LOCAL void (*delctx_func[NENT])( ID tskid );/* * Execute the processing function when task context is discarded. */LOCAL void atdelctx_exec( ID tskid ){	W	i;	for ( i = NENT - 1; i >= 0; --i ) {		if ( delctx_func[i] != NULL ) {			(*delctx_func[i])(tskid);		}	}}/* * Register the processing when task context is discarded. */EXPORT int __atdelctx( void (*func)( ID tskid ) ){	W	i;	(void)_lib_lock(_LL_MISC, TRUE);	for ( i = 0; i < NENT; ++i ) {		if ( delctx_func[i] == NULL ) {			delctx_func[i] = func;			__atdelctx_entry = atdelctx_exec;			break;		}	}	_lib_unlock(_LL_MISC);	return ( i < NENT )? 0: TSD_ADC_RTN_M1;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -