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

📄 lck.h

📁 SEED的VPM642测试程序-板级支持库
💻 H
字号:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) DSP/BIOS 4.90.270 12-18-03 (barracuda-o04)" */
/*
 *  ======== lck.h ========
 *  resource lock module - (was IR in 1.4)
 *
 */

#ifndef LCK_
#define LCK_

#include <sem.h>
#include <sys.h>
#include <tsk.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct LCK_Obj {
    SEM_Obj	sem;		/* use SEM_new() to initialize */
    Int		value;		/* current non-negative lock value */
    TSK_Handle	owner;		/* task handle of owner */
} LCK_Obj, *LCK_Handle;

typedef struct LCK_Attrs {
    Int	dummy;
} LCK_Attrs;

extern LCK_Attrs	LCK_ATTRS;

extern LCK_Handle	LCK_SYSTEM;	/* global system lock */

/*
 *  ======== LCK_create ========
 */
extern LCK_Handle LCK_create(LCK_Attrs *attrs);

/*
 *  ======== LCK_delete ========
 */
extern Void LCK_delete(LCK_Handle lock);

/*
 *  ======== LCK_init ========
 */
extern Void LCK_init();

/*
 *  ======== LCK_pend ========
 */
extern Bool LCK_pend(LCK_Handle lock, Uns timeout);

/*
 *  ======== LCK_post ========
 */
extern Void LCK_post(LCK_Handle lock);

/*
 *  ======== LCK_release ========
 *  macro for backwards compatibility -- LCK_post() is recommended
 */
#define LCK_release(lock)	LCK_post((lock))

/*
 *  ======== LCK_seize ========
 *  macro for backwards compatibility -- LCK_pend() is recommended
 */
#define LCK_seize(lock)		LCK_pend((lock), SYS_FOREVER)

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* LCK_ */

⌨️ 快捷键说明

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