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

📄 symtbllocklib.c

📁 This is a source code of VxWorks
💻 C
字号:
/* symTblLockLib.c - sym table locking mechanisms *//* Copyright 1984-1994 Wind River Systems, Inc. *//*modification history--------------------01c,05jan94,kdl	 general cleanup.01b,13dec93,dvs	 made NOMANUAL01a,06apr93,smb	 created*//*DESCRIPTIONThis module provides functionality for synchronizing the use of a symbol table created by symTblCreate(). INCLUDE FILES: SEE ALSO:NOMANUAL*/#include "vxWorks.h"#include "semLib.h"#include "symLib.h"/********************************************************************************* symTblLock - lock a name table.** This routine provides a mechanism for locking out a symbol table so that* it cannot be used by other tasks.** RETURNS: OK, or ERROR if <symTblId> invalid** NOMANUAL*/STATUS symTblLock    (    SYMTAB_ID symTblId         /* ID of symbol table to lock */    )    {    if (OBJ_VERIFY (symTblId, symTblClassId) != OK)        return (ERROR);                         /* invalid symbol table ID */    semTake (&symTblId->symMutex, WAIT_FOREVER);    return (OK);    }/********************************************************************************* symTblUnlock - Unlock a name table.** This routine unlocks a symbol table that has be locked via symTblLock().** RETURNS: OK, or ERROR if <symTblId> invalid** NOMANUAL*/STATUS symTblUnlock    (    SYMTAB_ID symTblId         /* ID of symbol table to unlock */    )    {    if (OBJ_VERIFY (symTblId, symTblClassId) != OK)        return (ERROR);                         /* invalid symbol table ID */    semGive (&symTblId->symMutex);          /* release mutual exclusion */    return (OK);    }

⌨️ 快捷键说明

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