📄 zaddtoresourcequeue.c
字号:
/*
* File : ZAddToResourceQueue.c
*
* Description : Adds a given thread to the resource queue.
*
* Copyright 2004 ZiLOG Inc. ALL RIGHTS RESERVED.
*
* This file contains unpublished confidential and proprietary information
* of ZiLOG, Inc.
* NO PART OF THIS WORK MAY BE DUPLICATED, STORED, PUBLISHED OR DISCLOSED
* IN ANY FORM WITHOUT THE PRIOR WRITTEN CONSENT OF ZiLOG, INC.
* This is not a license and no use of any kind of this work is authorized
* in the absence of a written license granted by ZiLOG, Inc. in ZiLOG's
* sole discretion
*/
#include "ZSysgen.h"
#include "ZTypes.h"
#include "ZThread.h"
#include "ZQueue.h"
#include "ZMessageQ.h"
extern RZK_THREADHANDLE_t hCurrentThread;
#define pThread ((RZK_TCB_t *) hThread)
#define pInsertionPos ((RZK_TCB_t *) hInsertionPos)
/*
* Function : AddToResourceQueue
*
* Description : Adds a given thread to the middle/end of resource queue.
*
* Inputs : pInsertionPos - Pointer to the insertion position.
* hThread - Handle of the thread to insert into the queue
*
* Outputs : void.
*
*
* Dependencies : None.
*/
void AddToResourceQueue( RZK_HANDLE_t hInsertionPos,RZK_THREADHANDLE_t hThread)
{
pThread->pResPrevious = pInsertionPos;
pThread->pResNext = pInsertionPos->pResNext ;
pInsertionPos->pResNext = pThread;
}
/*
* Function : AddToResourceQueueBeg
*
* Description : Adds a given thread to the beginning of resource queue.
*
* Inputs : pInsertionPos - Pointer to the insertion position.
* hThread - Handle of the thread to insert into the queue
*
* Outputs : void.
*
*
* Dependencies : None.
*/
#undef pInsertionPos
#define pInsertionPos ((RZK_MESSAGEQUEUE_t *)hInsertionPos)
void AddToResourceQueueBeg( RZK_HANDLE_t hInsertionPos,RZK_THREADHANDLE_t hThread)
{
pThread->pResPrevious = (RZK_TCB_t *) pInsertionPos;
pThread->pResNext = pInsertionPos->pResNext ;
pInsertionPos->pResNext = pThread;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -