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

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

?? semlib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* semLib.c - general semaphore library *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02j,09nov01,dee  add CPU_FAMILY != COLDFIRE in portable test02i,26oct01,bwa  Added semEvLib and eventLib to the list of 'SEE ALSO'                 modules.02h,12oct01,cjj  Added documentation regarding S_eventLib_EVENTSEND_FAILED                 error02g,06sep01,bwa  Added VxWorks events support.02f,16nov98,cdp  make ARM CPUs with ARM_THUMB==TRUE use portable routines.02f,03mar00,zl   merged SH support into T202e,05oct98,jmp  doc: cleanup.02d,17feb98,cdp  undo 02c: put ARM back in list of optimised CPUs.02c,21oct97,kkk  undo 02d, take out ARM from list of optimized CPUs.02d,19may97,jpd  added ARM to list of optimised CPUs.02c,17oct96,dgp  doc: add errnos for user-visible routines per SPR 689302b,13jun96,ms   conditionally compiled the windview instrumentation 02a,22oct95,jdi  doc: added bit values for semTake() timeout param (SPR 4276).01z,19mar95,dvs  removed tron references.01y,03feb95,rhp  edit SEMAPHORE DELETION manpage text, duplicate under semDelete()01x,18jan95,rhp  Doc errno value on semTake() return due to timeout (SPR#1930)01w,09jun93,hdn  added a support for I80X8601z,14apr94,smb  fixed class dereferencing for instrumentation macros01y,15mar94,smb  modified instrumentation macros01x,24jan94,smb  added instrumentation macros01w,10dec93,smb  added instrumentation01v,29jan93,pme  added little endian support for shared sempahores.01u,20jan93,jdi  documentation cleanup for 5.1.01t,13nov92,dnw  added include of smObjLib.h01s,02oct92,pme  added reference to shared semaphores documentation.01r,22jul92,pme  made semDestroy return S_smObjLib_NO_OBJECT_DESTROY when		 trying to destroy a shared semaphore.01q,19jul92,pme  added shared memory semaphores support.01p,04jul92,jcf  tables now initialized to null to reduce coupling.01o,26may92,rrr  the tree shuffle01n,15sep91,ajm  added MIPS to list of optimized CPU's01m,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -fixed #else and #endif		  -changed VOID to void		  -changed copyright notice01l,26sep91,hdn  added conditional flag for TRON optimized code.01k,15aug91,del  changed interface to qInit to pass all "optional" args.01j,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by jcf.01i,24mar91,jdi  documentation cleanup.01h,05oct90,dnw  made semTerminate() be NOMANUAL.01g,28aug90,jcf  documentation.01f,10aug90,dnw  corrected forward declaration of semQFlushDefer().01e,03aug90,jcf  documentation.01d,05jul90,jcf  optimized version now available.01c,26jun90,jcf  merged into one semaphore class.		 added semFlush ()01b,11may90,jcf  fixed up PORTABLE definition.01a,20oct89,jcf  written based on v1g of semLib.*//*DESCRIPTIONSemaphores are the basis for synchronization and mutual exclusion inVxWorks.  They are powerful in their simplicity and form the foundationfor numerous VxWorks facilities.Different semaphore types serve different needs, and while the behaviorof the types differs, their basic interface is the same.  This libraryprovides semaphore routines common to all VxWorks semaphore types.  Forall types, the two basic operations are semTake() and semGive(), theacquisition or relinquishing of a semaphore.Semaphore creation and initialization is handled by other libraries,depending on the type of semaphore used.  These libraries containfull functional descriptions of the semaphore types:    semBLib  - binary semaphores    semCLib  - counting semaphores    semMLib  - mutual exclusion semaphores    semSmLib - shared memory semaphoresBinary semaphores offer the greatest speed and the broadest applicability.The semLib library provides all other semaphore operations, includingroutines for semaphore control, deletion, and information.  Semaphoresmust be validated before any semaphore operation can be undertaken.  Aninvalid semaphore ID results in ERROR, and an appropriate `errno' is set.SEMAPHORE CONTROLThe semTake() call acquires a specified semaphore, blocking the callingtask or making the semaphore unavailable.  All semaphore types support atimeout on the semTake() operation.  The timeout is specified as thenumber of ticks to remain blocked on the semaphore.  Timeouts ofWAIT_FOREVER and NO_WAIT codify common timeouts.  If a semTake() timesout, it returns ERROR.  Refer to the library of the specific semaphore type for the exact behavior of this operation.The semGive() call relinquishes a specified semaphore, unblocking a pendedtask or making the semaphore available.  Refer to the library of thespecific semaphore type for the exact behavior of this operation.The semFlush() call may be used to atomically unblock all tasks pended ona semaphore queue, i.e., all tasks will be unblocked before any are allowedto run.  It may be thought of as a broadcast operation insynchronization applications.  The state of the semaphore is unchanged bythe use of semFlush(); it is not analogous to semGive().SEMAPHORE DELETIONThe semDelete() call terminates a semaphore and deallocates anyassociated memory.  The deletion of a semaphore unblocks tasks pendedon that semaphore; the routines which were pended return ERROR.  Takecare when deleting semaphores, particularly those used for mutualexclusion, to avoid deleting a semaphore out from under a task thatalready has taken (owns) that semaphore.  Applications should adoptthe protocol of only deleting semaphores that the deleting task hassuccessfully taken.SEMAPHORE INFORMATIONThe semInfo() call is a useful debugging aid, reporting all tasksblocked on a specified semaphore.  It provides a snapshot of the queue atthe time of the call, but because semaphores are dynamic, the informationmay be out of date by the time it is available.  As with the current state ofthe semaphore, use of the queue of pended tasks should be restricted todebugging uses only.VXWORKS EVENTSIf a task has registered for receiving events with a semaphore, events will besent when that semaphore becomes available. By becoming available, it isimplied that there is a change of state. For a binary semaphore, there is only a change of state when a semGive() is done on a semaphore that was taken. For a counting semaphore, there is always a change of state when the semaphore is available, since the count is incremented each time. For a mutex, a semGive() can only be performed if the current task is the owner, implying that the semaphore has been taken; thus, there is always a change of state.INTERNAL:	WINDVIEW INSTRUMENTATIONLevel 1:	semGive() causes EVENT_SEMGIVE		(portable only)	semTake() causes EVENT_SEMTAKE		(portable only)	semFlush() causes EVENT_SEMFLUSH	semDestroy() causes EVENT_SEMDELETELevel 2:	semGive() causes EVENT_OBJ_SEMGIVE	(portable only)	semTake() causes EVENT_OBJ_SEMTAKE	(portable only)	semFlush() causes EVENT_OBJ_SEMFLUSH	Level 3:	N/AINCLUDE FILES: semLib.hSEE ALSO: taskLib, semBLib, semCLib, semMLib, semSmLib, semEvLib, eventLib,.pG "Basic OS"*/#include "vxWorks.h"#include "taskLib.h"#include "qLib.h"#include "intLib.h"#include "errno.h"#include "smObjLib.h"#include "private/eventLibP.h"#include "private/classLibP.h"#include "private/eventP.h"#include "private/objLibP.h"#include "private/semLibP.h"#include "private/windLibP.h"#include "private/workQLibP.h"#include "private/semSmLibP.h"/* optimized version available for 680X0, MIPS, i86, SH, *//* COLDFIRE and ARM (excluding Thumb) */#if (defined(PORTABLE) || \     ((CPU_FAMILY != MC680X0) && \      (CPU_FAMILY != MIPS) && \      (CPU_FAMILY != I80X86) && \      (CPU_FAMILY != SH) && \      (CPU_FAMILY != COLDFIRE) && \      (CPU_FAMILY != ARM)) || \     ((CPU_FAMILY == ARM) && ARM_THUMB))#define semLib_PORTABLE#endif/* locals */LOCAL BOOL	semLibInstalled;		/* protect from muliple inits *//* globals */OBJ_CLASS semClass;				/* semaphore object class */CLASS_ID  semClassId = &semClass;		/* semaphore class ID */#ifdef	WV_INSTRUMENTATIONOBJ_CLASS semInstClass;				/* semaphore object class */CLASS_ID  semInstClassId = &semInstClass;	/* semaphore class ID */#endifFUNCPTR semGiveTbl [MAX_SEM_TYPE] =		/* semGive() methods by type */    {    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid    };FUNCPTR semTakeTbl [MAX_SEM_TYPE] =		/* semTake() methods by type */    {    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid    };FUNCPTR semFlushTbl [MAX_SEM_TYPE] =		/* semFlush() methods by type */    {    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid, (FUNCPTR) semInvalid,    (FUNCPTR) semInvalid, (FUNCPTR) semInvalid    };FUNCPTR semGiveDeferTbl [MAX_SEM_TYPE] =	/* semGiveDefer() methods */    {    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL,    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL    };FUNCPTR semFlushDeferTbl [MAX_SEM_TYPE] =	/* semFlushDefer() methods */    {    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL,    (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) NULL    };/********************************************************************************* semLibInit - initialize the semaphore management package** This routine initializes the semaphore object class.  No semaphore* operation will work until this is called.  This routine is called during* system configuration within kernelInit().  This routine should only be* called once.** SEE ALSO: classLib* NOMANUAL*/STATUS semLibInit (void)    {    if ((!semLibInstalled) &&	(classInit (semClassId, sizeof(SEMAPHORE), OFFSET(SEMAPHORE,objCore),         (FUNCPTR) NULL, (FUNCPTR) NULL, (FUNCPTR) semDestroy) == OK))	{#ifdef	WV_INSTRUMENTATION	/* initialise instrumented class for semaphores */	semClassId->initRtn = semInstClassId;        classInstrument (semClassId, semInstClassId);#endif	semEvLibInit (); /* pull semaphore-related events lib in kernel */	semLibInstalled = TRUE;	}    return ((semLibInstalled) ? OK : ERROR);    }#ifdef semLib_PORTABLE/********************************************************************************* semGive - give a semaphore** This routine performs the give operation on a specified semaphore.* Depending on the type of semaphore, the state of the semaphore and of the* pending tasks may be affected.  If no tasks are pending on the sempahore and* a task has previously registered to receive events from the semaphore, these* events are sent in the context of this call.  This may result in the* unpending of the task waiting for the events.  If the semaphore fails to* send events and if it was created using the SEM_EVENTSEND_ERR_NOTIFY * option, ERROR is returned even though the give operation was successful.* The behavior of semGive() is discussed fully in the library description * of the specific semaphore type being used.** RETURNS: OK on success or ERROR otherwise** ERRNO:* .iP "S_intLib_NOT_ISR_CALLABLE"* Routine was called from an ISR for a mutex semaphore.* .iP "S_objLib_OBJ_ID_ERROR"* Semaphore ID is invalid.* .iP "S_semLib_INVALID_OPERATION"* Current task not owner of mutex semaphore.* .iP "S_eventLib_EVENTSEND_FAILED"* Semaphore failed to send events to the registered task.  This errno * value can only exist if the semaphore was created with the * SEM_EVENTSEND_ERR_NOTIFY option.* .LP** SEE ALSO: semBLib, semCLib, semMLib, semSmLib, semEvStart*/STATUS semGive    (    SEM_ID semId        /* semaphore ID to give */    )    {    SM_SEM_ID  smObjSemId;	/* shared semaphore ID */    /* check if semaphore is shared */    if (ID_IS_SHARED (semId))  	{	smObjSemId = (SM_SEM_ID) SM_OBJ_ID_TO_ADRS(semId);	return ((*semGiveTbl[ntohl (smObjSemId->objType) & SEM_TYPE_MASK])		(smObjSemId));	}    /* otherwise the semaphore is local */#ifdef	WV_INSTRUMENTATION    /* windview - level 1 event logging */    EVT_OBJ_3 (OBJ, semId, semClassId, EVENT_SEMGIVE, semId, 		semId->state, semId->recurse);#endif    if (kernelState)	return (semGiveDefer (semId));      /* defer semaphore give */    else	return((* semGiveTbl[semId->semType & SEM_TYPE_MASK]) (semId));    }/********************************************************************************* semTake - take a semaphore** This routine performs the take operation on a specified semaphore.* Depending on the type of semaphore, the state of the semaphore and* the calling task may be affected.  The behavior of semTake() is* discussed fully in the library description of the specific semaphore * type being used.** A timeout in ticks may be specified.  If a task times out, semTake() will* return ERROR.  Timeouts of WAIT_FOREVER (-1) and NO_WAIT (0) indicate to wait* indefinitely or not to wait at all.** When semTake() returns due to timeout, it sets the errno to* S_objLib_OBJ_TIMEOUT (defined in objLib.h).* * The semTake() routine is not callable from interrupt service routines.** RETURNS: OK, or ERROR if the semaphore ID is invalid or the task timed out.** ERRNO: S_intLib_NOT_ISR_CALLABLE, S_objLib_OBJ_ID_ERROR,*        S_objLib_OBJ_UNAVAILABLE** SEE ALSO: semBLib, semCLib, semMLib, semSmLib*/STATUS semTake    (    SEM_ID semId,       /* semaphore ID to take */    int timeout         /* timeout in ticks */    )    {    SM_SEM_ID  smObjSemId;      /* shared semaphore ID */    /* check if semaphore is global (shared) */    if (ID_IS_SHARED (semId))	{	smObjSemId = (SM_SEM_ID) SM_OBJ_ID_TO_ADRS(semId);        return ((* semTakeTbl[ntohl (smObjSemId->objType) & SEM_TYPE_MASK ]) 		 (smObjSemId, timeout));	}    /* otherwise sempahore is local */#ifdef	WV_INSTRUMENTATION    /* windview - level 1 event logging */    EVT_OBJ_3 (OBJ, semId, semClassId, EVENT_SEMTAKE, semId, 		semId->state, semId->recurse);#endif    return ((* (semTakeTbl[semId->semType & SEM_TYPE_MASK])) (semId, timeout));    }#endif	/* semLib_PORTABLE *//********************************************************************************* semFlush - unblock every task pended on a semaphore** This routine atomically unblocks all tasks pended on a specified* semaphore, i.e., all tasks will be unblocked before any is allowed

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一二三区不卡| 国产精品久久久久7777按摩| 久久综合给合久久狠狠狠97色69| 亚洲人吸女人奶水| 国内精品国产成人国产三级粉色 | 亚洲另类春色校园小说| 久久精品噜噜噜成人88aⅴ| 在线看国产一区二区| 国产精品婷婷午夜在线观看| 香蕉成人啪国产精品视频综合网 | 中文字幕在线不卡国产视频| 久久国内精品视频| 欧美二区三区的天堂| 亚洲一区二区在线免费看| 成人丝袜视频网| 久久一留热品黄| 久久精品99国产精品日本| 欧美性大战久久久久久久 | 高清不卡一区二区| 精品女同一区二区| 美女网站色91| 日韩欧美一区电影| 日韩精品一区第一页| 精品视频999| 亚洲成人黄色影院| 欧美日本在线播放| 午夜精品影院在线观看| 欧美美女直播网站| 亚洲综合免费观看高清在线观看| www.99精品| 亚洲另类中文字| 在线观看亚洲精品视频| 一区二区三区中文字幕在线观看| 91美女精品福利| 一区二区成人在线| 欧美午夜精品免费| 日产欧产美韩系列久久99| 91精品国产一区二区三区| 男人的天堂亚洲一区| 欧美va亚洲va国产综合| 国产一区二区三区在线看麻豆| 久久综合色8888| 国产成人精品免费| 亚洲特级片在线| 欧美日韩黄色一区二区| 免费在线一区观看| 国产欧美日韩在线| 色呦呦国产精品| 天使萌一区二区三区免费观看| 欧美一区二区久久久| 国产乱码字幕精品高清av| 久久久久99精品一区| 91丝袜国产在线播放| 五月婷婷综合在线| 欧美精品一区二区三| av电影在线观看完整版一区二区| 亚洲精品第一国产综合野| 欧美一区二区三区爱爱| 成人精品视频一区二区三区尤物| 亚洲精品国产高清久久伦理二区| 欧美日韩国产首页在线观看| 狠狠色丁香九九婷婷综合五月| 国产精品理伦片| 欧美日韩国产大片| 国内久久精品视频| 国产精品久久毛片av大全日韩| 在线免费av一区| 国产精品996| 亚洲国产精品久久一线不卡| 精品国产99国产精品| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 天堂va蜜桃一区二区三区 | 天天综合天天做天天综合| 精品久久久久一区| 91福利精品视频| 国产一区二区三区香蕉| 亚洲韩国一区二区三区| 国产亚洲va综合人人澡精品| 欧美剧在线免费观看网站| 成人少妇影院yyyy| 日本不卡1234视频| 一区二区三区产品免费精品久久75| 日韩精品一区二| 欧美三级视频在线观看| www.久久精品| 国产一区二区三区四区五区入口 | 亚洲美女视频在线| 久久精品男人天堂av| 日韩一级高清毛片| 欧美主播一区二区三区| 99re亚洲国产精品| 国产超碰在线一区| 极品少妇一区二区| 日韩av电影一区| 三级不卡在线观看| 亚洲国产精品久久人人爱蜜臀| 国产精品二三区| 国产日韩欧美一区二区三区乱码| 91精品婷婷国产综合久久| 欧美丝袜丝nylons| 91福利视频久久久久| 91视频xxxx| 一本到高清视频免费精品| 成人高清av在线| 不卡一卡二卡三乱码免费网站| 国产一区二区不卡在线| 韩日精品视频一区| 九九视频精品免费| 久久电影网电视剧免费观看| 青青草原综合久久大伊人精品优势| 亚洲一级二级三级| 亚洲国产精品一区二区www在线| 亚洲精品乱码久久久久久 | 色偷偷88欧美精品久久久| 国产精品一区二区三区乱码| 久久99精品久久只有精品| 亚洲五码中文字幕| 爽好久久久欧美精品| 天堂一区二区在线| 蜜桃视频第一区免费观看| 激情综合色丁香一区二区| 国产美女视频91| 成人免费观看视频| 一本色道久久综合亚洲91| 色噜噜狠狠色综合欧洲selulu| 在线观看精品一区| 欧美日韩一区二区三区四区| 欧美美女直播网站| 精品国产91九色蝌蚪| 欧美极品美女视频| 1000精品久久久久久久久| 亚洲精品一二三四区| 丝袜a∨在线一区二区三区不卡| 美女网站色91| 成人午夜激情在线| 欧美中文字幕一区| 欧美mv和日韩mv国产网站| 中文字幕巨乱亚洲| 亚洲成人av一区二区三区| 久久99精品久久久久久国产越南| 国产99一区视频免费| 91成人网在线| 精品av综合导航| 夜夜嗨av一区二区三区网页| 麻豆精品在线播放| 成人综合婷婷国产精品久久| 91黄色激情网站| 精品国产91亚洲一区二区三区婷婷| 国产精品青草综合久久久久99| 亚洲一区二区免费视频| 国产精品911| 欧美理论片在线| 国产精品久久久久久福利一牛影视| 亚洲成人免费影院| 国产91精品久久久久久久网曝门| 欧美视频一区在线| 国产亚洲va综合人人澡精品| 婷婷成人综合网| 成人app网站| 精品国产乱码91久久久久久网站| 亚洲婷婷国产精品电影人久久| 蜜臀精品久久久久久蜜臀| 99re成人精品视频| 久久久美女毛片| 蜜桃久久久久久| 一本大道久久a久久综合| 久久婷婷国产综合国色天香| 亚洲国产aⅴ天堂久久| 成人av在线网| 久久亚洲精品小早川怜子| 天天av天天翘天天综合网 | 7777精品伊人久久久大香线蕉的| 久久久青草青青国产亚洲免观| 日日夜夜免费精品视频| 91美女片黄在线观看| 欧美激情艳妇裸体舞| 国内精品伊人久久久久影院对白| 91精品国产综合久久小美女| 亚洲精品福利视频网站| 97久久精品人人爽人人爽蜜臀| www精品美女久久久tv| 免费在线一区观看| 91精品国产高清一区二区三区蜜臀 | 水蜜桃久久夜色精品一区的特点| 色婷婷香蕉在线一区二区| 欧美高清一级片在线观看| 狠狠色丁香久久婷婷综合_中 | 国产美女av一区二区三区| 欧美一级搡bbbb搡bbbb| 午夜免费久久看| 欧美色涩在线第一页| 亚洲一区自拍偷拍| 欧美日韩一区视频| 亚洲国产精品久久久久婷婷884 | 黄色精品一二区| 日韩视频在线观看一区二区| 午夜亚洲国产au精品一区二区| 色婷婷综合久久久久中文| 亚洲日本免费电影| 欧美色爱综合网|