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

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

?? tasklib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
STATUS taskDestroy    (    int  tid,                   /* task ID of task to delete */    BOOL dealloc,               /* deallocate associated memory */    int  timeout,               /* time willing to wait */    BOOL forceDestroy           /* force deletion if protected */    )    {    FAST int	  ix;		/* delete hook index */    FAST WIND_TCB *pTcb;	/* convenient pointer to WIND_TCB */    FAST int      lock;		/* to lock interrupts */    int		  status;	/* windDelete return status */    if (INT_RESTRICT () != OK)				/* no ISR use */	return (ERROR);    if (tid == 0)	pTcb = taskIdCurrent;				/* suicide */    else	pTcb = (WIND_TCB *) tid;			/* convenient pointer */#ifdef WV_INSTRUMENTATION    /* windview - level 1 event logging */    EVT_OBJ_2 (TASK, pTcb, taskClassId, EVENT_TASKDESTROY, pTcb, pTcb->safeCnt);#endif    if ((pTcb == taskIdCurrent) && (_func_excJobAdd != NULL))	{	/* If exception task is available, delete task from its context.	 * While suicides are supported without an exception task, it seems	 * safer to utilize another context for deletion.	 */		while (pTcb->safeCnt > 0)			/* make task unsafe */	    TASK_UNSAFE ();	_func_excJobAdd (taskDestroy, (int)pTcb, dealloc, NO_WAIT, FALSE);	FOREVER	    taskSuspend (0);				/* wait to die */	}again:    lock = intLock ();					/* LOCK INTERRTUPTS */    if (TASK_ID_VERIFY (pTcb) != OK)			/* valid task ID? */	{	intUnlock (lock);				/* UNLOCK INTERRUPTS */	return (ERROR);	}    /*     * Mask all signals of pTcb (may be suicide)     * This is the same as calling sigfillset(&pTcb->pSignalInfo->sigt_blocked)     * without the call to sigLib     */    if (pTcb->pSignalInfo != NULL)	pTcb->pSignalInfo->sigt_blocked = 0xffffffff;    while ((pTcb->safeCnt > 0) ||	   ((pTcb->status == WIND_READY) && (pTcb->lockCnt > 0)))	{	kernelState = TRUE;				/* KERNEL ENTER */	intUnlock (lock);				/* UNLOCK INTERRUPTS */	if ((forceDestroy) || (pTcb == taskIdCurrent))	    {	    pTcb->safeCnt = 0;				/* unprotect */	    pTcb->lockCnt = 0;				/* unlock */	    if (Q_FIRST (&pTcb->safetyQHead) != NULL)	/* flush safe queue */                {#ifdef WV_INSTRUMENTATION                /* windview - level 2 event logging */                EVT_TASK_1 (EVENT_OBJ_TASK, pTcb);#endif                windPendQFlush (&pTcb->safetyQHead);                }	    windExit ();				/* KERNEL EXIT */	    }	else						/* wait to destroy */	    {#ifdef WV_INSTRUMENTATION            /* windview - level 2 event logging */            EVT_TASK_1 (EVENT_OBJ_TASK, pTcb);  /* log event */#endif	    if (windPendQPut (&pTcb->safetyQHead, timeout) != OK)		{		windExit ();				/* KERNEL EXIT */		return (ERROR);		}	    switch (windExit())		{		case RESTART :		    /* Always go back and reverify, this is because we have		     * been running in a signal handler for who knows how long.		     */		    timeout = SIG_TIMEOUT_RECALC(timeout);		    goto again;		case ERROR :				/* timed out */		    return (ERROR);		default :				/* we were flushed */		    break;		}	    /* All deleters of safe tasks block here.  When the safeCnt goes	     * back to zero (or we taskUnlock) the deleters will be unblocked	     * and the highest priority task among them will be elected to	     * complete the deletion.  All unelected deleters will ultimately	     * find the ID invalid, and return ERROR when they proceed from	     * here.  The complete algorithm is summarized below.	     */	     }	lock = intLock ();				/* LOCK INTERRTUPTS */	if (TASK_ID_VERIFY (pTcb) != OK)	    {	    intUnlock (lock);				/* UNLOCK INTERRUPTS */	    errno = S_objLib_OBJ_DELETED;	    return (ERROR);	    }	}    /* We can now assert that one and only one task has been elected to     * perform the actual deletion.  The elected task may even be the task     * to be deleted in the case of suicide.  To guarantee all other tasks     * flushed from the safe queue receive an ERROR notification, the     * elected task reprotects the victim from deletion.     *      * A task flushed from the safe queue checks if the task ID is invalid,     * which would mean the deletion is completed.  If, on the other hand,     * the task ID is valid, one of two possibilities exist.  One outcome is     * the flushed task performs the test condition in the while statement     * above and finds the safe count equal to zero.  In this case the     * flushed task is the elected deleter.     *      * The second case is that the safe count is non-zero.  The only way the     * safe count can be non zero after being flushed from the delete queue     * is if the elected deleter blocked before completing the deletion or     * the victim managed to legitimately taskSafe() itself in one way or     * another.  A deleter can block because before performing the deletion     * and hence task ID invalidation, the deleter must call the delete     * hooks that possibly deallocate memory which involves taking a     * semaphore.  So observe that nothing prevents the deleter from being     * preempted by some other task which might also try a deletion on the     * same victim.  We need not account for this case in any special way     * because the task will atomically find the ID valid but the safe count     * non zero and thus block on the safe queue.  It is therefore     * impossible for two deletions to occur on the same task being killed     * by one or more deleters.     *      * We must also protect the deleter from being deleted by utilizing     * taskSafe().  When a safe task is deleting itself the safe count is     * set equal to zero, and other deleters are flushed from the safe     * queue.  From this point on the algorithm remains the same.     *      * The only special problem a suicide presents is deallocating the     * memory associated with the task.  When we free the memory, we must     * prevent any preemption from occuring, thus opening up an opportunity     * for the memory to be allocated out from under us and corrupted.  We     * lock preemption before the objFree() call.  The task may block     * waiting for the partition, but once access is gained no further     * preemption will occur.  An alternative to locking preemption is to     * lock the partition by taking the partition's semaphore.  If the     * partition utilizes mutex semaphores which permit recursive access, this     * alternative seems attractive.  However, the memory manager will utilize     * binary semaphores when scaled down.  With a fixed duration memPartFree()     * algorithm, a taskLock() does not seem excessive compared to a more     * intimate coupling with memPartLib.     *      * One final complication exists before task invalidation and kernel     * queue removal can be completed.  If we enter the kernel and     * invalidate the task ID, there is a brief opportunity for an ISR to     * add work to the kernel work queue referencing the soon to be defunct     * task ID.  To prevent this we lock interrupts before invalidating the     * task ID, and then enter the kernel.  Conclusion of the algorithm     * consists of removing the task from the kernel queues, flushing the     * unelected deleters to receive ERROR notification, exiting the kernel,     * and finally restoring the deleter to its original state with     * taskUnsafe(), and taskUnlock().     */    TASK_SAFE ();					/* protect deleter */    pTcb->safeCnt ++;					/* reprotect victim */    if (pTcb != taskIdCurrent)				/* if not a suicide */	{	kernelState = TRUE;				/* ENTER KERNEL */	intUnlock (lock);				/* UNLOCK INTERRUPTS */	windSuspend (pTcb);				/* suspend victim */	windExit ();					/* EXIT KERNEL */	}    else	intUnlock (lock);				/* UNLOCK INTERRUPTS */    /* run the delete hooks in the context of the deleting task */    for (ix = 0; ix < VX_MAX_TASK_DELETE_RTNS; ++ix)	if (taskDeleteTable[ix] != NULL)	    (*taskDeleteTable[ix]) (pTcb);    TASK_LOCK ();					/* LOCK PREEMPTION */    if ((dealloc) && (pTcb->options & VX_DEALLOC_STACK))        {	if (pTcb == (WIND_TCB *) rootTaskId)	    memAddToPool (pRootMemStart, rootMemNBytes);/* add root into pool */	else#if 	(_STACK_DIR == _STACK_GROWS_DOWN)	    /*	     * A portion of the very top of the stack is clobbered with a	     * FREE_BLOCK in the objFree() associated with taskDestroy(). 	     * There is no adverse consequence of this, and is thus not 	     * accounted for.	     */	    objFree (taskClassId, pTcb->pStackEnd);#else	/* _STACK_GROWS_UP */	    /*	     * To protect a portion of the WIND_TCB that is clobbered with a	     * FREE_BLOCK in this objFree() we previously goosed up the base of	     * tcb by 16 bytes.	     */	    objFree (taskClassId, (char *) pTcb - 16);#endif	}    lock = intLock ();					/* LOCK INTERRUPTS */    objCoreTerminate (&pTcb->objCore);			/* INVALIDATE TASK */    kernelState = TRUE;					/* KERNEL ENTER */    intUnlock (lock);					/* UNLOCK INTERRUPTS */    status = windDelete (pTcb);				/* delete task */    /*      * If the task being deleted is the last Fp task from fppSwapHook then     * reset pTaskLastFpTcb.      */    if (pTcb == pTaskLastFpTcb)    	pTaskLastFpTcb = NULL;				    /*     * If the task being deleted is the last DSP task from dspSwapHook then     * reset pTaskLastDspTcb.     */    if (pTcb == pTaskLastDspTcb)    	pTaskLastDspTcb = NULL;#ifdef _WRS_ALTIVEC_SUPPORT    /*     * If the task being deleted is the last Altivec task from      * altivecSwapHook then reset pTaskLastAltivecTcb.     */    if (pTcb == pTaskLastAltivecTcb)        pTaskLastAltivecTcb = NULL;#endif /* _WRS_ALTIVEC_SUPPORT */    /*     * Now if the task has used shared memory objects the following      * can happen :     *     * 1) windDelete has return OK indicating that the task      * was not pending on a shared semaphore or was pending on a     * shared semaphore but its shared TCB has been removed from the     * shared semaphore pendQ.  In that case we simply give the      * shared TCB back to the shared TCB partition.     * If an error occurs while giving back the shared TCB a warning     * message in sent to the user saying the shared TCB is lost.     *     * 2) windDelete has return ALREADY_REMOVED indicating that the task     * was pending on a shared semaphore but its shared TCB has already     * been removed from the shared semaphore pendQ by another CPU.     * Its shared TCB is now in this CPU event list but has not yet     * shown-up.  In that case we don't free the shared TCB now since     * it will screw up the CPU event list, the shared TCB will be freed     * by smObjEventProcess when it will show-up.     *     * 3) This is the worst case, windDelete has return ERROR     * indicating that the task was pending on a shared semaphore      * and qFifoRemove has failed when trying to get the lock to     * the shared semaphore structure.     * In that case the shared semaphore pendQ is in an inconsistant     * state because it still contains a shared TCB of task which     * no longer exist.  We send a message to the user saying     * that access to a shared structure has failed.     */     /* no failure notification until we have a better solution */    if (pTcb->pSmObjTcb != NULL)			/* sm tcb to free? */	{	if (status == OK)		    {						/* free sm tcb */	    (*smObjTcbFreeRtn) (pTcb->pSmObjTcb);		    }	}    if (Q_FIRST (&pTcb->safetyQHead) != NULL)		/*flush any deleters */        {#ifdef WV_INSTRUMENTATION        /* windview - level 2 event logging */        EVT_TASK_1 (EVENT_OBJ_TASK, pTcb);      /* log event */#endif        windPendQFlush (&pTcb->safetyQHead);        }    windExit ();					/* KERNEL EXIT */    /* we won't get here if we committed suicide */    taskUnlock ();					/* UNLOCK PREEMPTION */    taskUnsafe ();					/* TASK UNSAFE */    return (OK);    }/********************************************************************************* taskSuspend - suspend a task** This routine suspends a specified task.  A task ID of zero results in* the suspension of the calling task.  Suspension is additive, thus tasks* can be delayed and suspended, or pended and suspended.  Suspended, delayed* tasks whose delays expire remain suspended.  Likewise, suspended,* pended tasks that unblock remain suspended only.** Care should be taken with asynchronous use of this facility.  The specified* task is suspended regardless of its current state.  The task could, for* instance, have mutual exclusion to some system resource, such as the network * or system memory partition.  If suspended during such a time, the facilities* engaged are unavailable, and the situation often ends in deadlock.** This routine is the basis of the debugging and exception handling packages.* However, as a synchronization mechanism, this facility should be rejected * in favor of the more general semaphore facility.*

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕欧美三区| 亚洲国产综合在线| 欧美老女人第四色| youjizz国产精品| 麻豆精品久久久| 亚洲国产日韩精品| 国产精品毛片高清在线完整版| 日韩一二在线观看| 91女人视频在线观看| 韩日欧美一区二区三区| 五月天中文字幕一区二区| 国产精品传媒入口麻豆| 亚洲精品在线观| 欧美一区二区免费视频| 欧美色图12p| 日本久久精品电影| av一区二区三区四区| 国产成人在线免费观看| 国产综合久久久久影院| 全国精品久久少妇| 亚洲国产美国国产综合一区二区| 国产精品久久久久久久久搜平片| 久久精品夜夜夜夜久久| 久久综合丝袜日本网| 日韩你懂的电影在线观看| 欧美老肥妇做.爰bbww视频| 欧美综合一区二区三区| 91麻豆自制传媒国产之光| 成人黄色一级视频| 成人av先锋影音| 成人小视频免费观看| 国产超碰在线一区| 成人永久看片免费视频天堂| 国产成人在线网站| 成人国产在线观看| www.性欧美| 色一情一伦一子一伦一区| 99国产精品久| 欧美性一二三区| 欧美日韩国产一区| 7777精品伊人久久久大香线蕉最新版| 欧美日韩卡一卡二| 91精品国产免费| 日韩欧美高清一区| 337p粉嫩大胆色噜噜噜噜亚洲| 2020国产精品自拍| 日本一区二区三区四区在线视频 | 亚洲综合一区二区三区| 亚洲欧洲综合另类在线 | 国内精品免费在线观看| 国产美女娇喘av呻吟久久| 国产91丝袜在线18| 91小视频免费看| 欧美午夜不卡在线观看免费| 欧美巨大另类极品videosbest | 欧美成人vr18sexvr| 精品国产1区2区3区| 国产日产欧产精品推荐色| 中文字幕日韩av资源站| 亚洲综合图片区| 日韩影院精彩在线| 国产在线视频精品一区| 成人高清视频在线| 欧美午夜影院一区| 精品国产乱码久久久久久夜甘婷婷| 2019国产精品| 一区二区在线观看免费视频播放| 亚洲国产色一区| 国产一区二区按摩在线观看| 93久久精品日日躁夜夜躁欧美| 欧美精品一二三| 久久久久久久久免费| 亚洲视频资源在线| 久久99久久99| 色综合天天综合网天天狠天天 | 国产盗摄一区二区三区| 91在线精品秘密一区二区| 欧美精品免费视频| 久久久精品免费免费| 悠悠色在线精品| 国产一区二区三区四区五区美女| 99久久99久久精品免费看蜜桃 | 亚洲欧美激情小说另类| 日本最新不卡在线| eeuss鲁片一区二区三区在线观看| 欧美午夜精品理论片a级按摩| 久久免费国产精品| 亚洲精品视频一区二区| 国内成人精品2018免费看| 在线观看不卡视频| 国产无遮挡一区二区三区毛片日本| 一级中文字幕一区二区| 国产精品18久久久久久久久久久久| 欧美色偷偷大香| 亚洲人成亚洲人成在线观看图片 | 成人18视频在线播放| 欧美一区三区四区| 亚洲欧美日本在线| 成人黄色在线视频| 久久亚洲精华国产精华液 | 日本成人在线网站| 日本韩国欧美国产| 国产婷婷色一区二区三区在线| 偷拍一区二区三区| 色综合久久综合中文综合网| 久久久影院官网| 久久国产乱子精品免费女| 精品视频一区二区三区免费| 中文字幕一区二| 九九视频精品免费| 5858s免费视频成人| 一区二区在线观看免费| 韩国精品久久久| 欧美一区二区三区啪啪| 亚洲综合色网站| 91麻豆精品在线观看| 欧美激情中文字幕| 激情丁香综合五月| 欧美一区三区四区| 青青草国产精品亚洲专区无| 欧美妇女性影城| 亚洲国产一区二区a毛片| 色综合欧美在线| 亚洲精品成人精品456| 99久久亚洲一区二区三区青草| 国产性做久久久久久| 国产一区二区伦理片| 久久这里只有精品视频网| 久草在线在线精品观看| 精品国产乱码久久久久久1区2区 | 国产精品亚洲第一| 国产丝袜欧美中文另类| 国产成人自拍在线| 中文字幕+乱码+中文字幕一区| 精品亚洲国产成人av制服丝袜| 精品久久人人做人人爽| 久久国产精品色婷婷| 久久精品视频免费| 高清不卡在线观看| 亚洲人成电影网站色mp4| 91免费精品国自产拍在线不卡| 亚洲乱码国产乱码精品精可以看 | 亚洲一区二区三区四区在线| 91麻豆精品一区二区三区| 亚洲色图丝袜美腿| 欧美视频一区二区三区在线观看| 一区二区三区色| 欧美日韩亚洲综合一区二区三区| 亚洲18色成人| 精品国产网站在线观看| 国产盗摄精品一区二区三区在线| 国产精品久久免费看| 91激情在线视频| 日本中文在线一区| 国产亲近乱来精品视频| www.激情成人| 亚洲.国产.中文慕字在线| 日韩欧美高清在线| 成人一区在线观看| 亚洲精品高清在线观看| 欧美人妇做爰xxxⅹ性高电影| 久久99久久99精品免视看婷婷 | 亚洲 欧美综合在线网络| 精品久久久久久无| 99re66热这里只有精品3直播 | 亚洲国产精品国自产拍av| 色综合一区二区| 青青草原综合久久大伊人精品优势| 国产亚洲精品资源在线26u| 波多野结衣中文字幕一区 | 亚洲激情第一区| 91麻豆精品国产91久久久久 | 亚洲一区二区三区激情| 精品欧美久久久| 91视频精品在这里| 美国精品在线观看| 亚洲免费电影在线| 精品国产一区二区三区久久影院| 91在线观看免费视频| 久久精品国产77777蜜臀| 国产精品成人免费| 欧美一区二视频| 91色.com| 国产精品亚洲一区二区三区在线 | 青青草原综合久久大伊人精品优势 | 91久久精品一区二区| 久久国产精品一区二区| 尤物在线观看一区| 欧美国产视频在线| 欧美一级免费观看| 91色porny在线视频| 国产老肥熟一区二区三区| 午夜欧美在线一二页| 亚洲品质自拍视频| 久久精品欧美日韩| 精品入口麻豆88视频| 欧美日韩另类一区| 色婷婷av一区二区三区gif| 国产盗摄视频一区二区三区| 日本va欧美va瓶|