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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? semblib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* semBLib.c - binary semaphore library *//* Copyright 1984-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02h,03may02,pcm  removed possible NULL dereference in semBCreate () (SPR 76721)02g,09nov01,dee  add CPU_FAMILY != COLDFIRE in portable test02f,18oct01,bwa  Fixed problem when the semaphore could be deleted while                 sending events.02e,06sep01,bwa  Added VxWorks events support.02d,04sep98,cdp  make ARM CPUs with ARM_THUMB==TRUE use portable routines.02d,03mar00,zl   merged SH support into T202c,17feb98,cdp  undo 02b: put ARM back in list of optimised CPUs.02b,21oct97,kkk  undo 02a, take out ARM from list of optimized CPUs.02a,19may97,jpd  added ARM to list of optimised CPUs.01z,24jun96,sbs  made windview instrumentation conditionally compiled01y,22oct95,jdi  doc: added bit values for semBCreate() options (SPR 4276).01w,19mar95,dvs  removed tron references.01v,09jun93,hdn  added a support for I80X8601y,14apr94,smb  fixed class dereferencing for instrumentation macros01x,15mar94,smb  modified instrumentation macros01w,24jan94,smb  added instrumentation macros01v,10dec93,smb  added instrumentation01u,23jan93,jdi  documentation cleanup for 5.1.01t,13nov92,jcf  semBCreate call semBLibInit for robustness.01s,28jul92,jcf  semB{Create,Init} call semBLibInit for robustness.01r,09jul92,rrr  changed xsignal.h to private/sigLibP.h01q,04jul92,jcf  tables now start as null to reduce coupling; private headers01p,26may92,rrr  the tree shuffle01o,27apr92,rrr  added signal restarting01n,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,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by jcf.01j,25mar91,del  fixed bug introduced in 02i that wouldn't allow build.01i,24mar91,jdi  documentation cleanup.01h,05oct90,dnw  made semBInit() be NOMANUAL.01g,29aug90,jcf  documentation.01f,03aug90,jcf  documentation.01e,17jul90,dnw  changed to new objAlloc() call01d,05jul90,jcf  optimized version now available.01c,26jun90,jcf  merged to one semaphore class.01b,11may90,jcf  fixed up PORTABLE definition.01a,20oct89,jcf  written based on v1g of semLib.*//*DESCRIPTIONThis library provides the interface to VxWorks binary semaphores.Binary semaphores are the most versatile, efficient, and conceptuallysimple type of semaphore.  They can be used to: (1) control mutuallyexclusive access to shared devices or data structures, or (2) synchronizemultiple tasks, or task-level and interrupt-level processes.  Binarysemaphores form the foundation of numerous VxWorks facilities.A binary semaphore can be viewed as a cell in memory whose contents are inone of two states, full or empty.  When a task takes a binary semaphore,using semTake(), subsequent action depends on the state of the semaphore:.IP (1) 4If the semaphore is full, the semaphore is made empty, and the calling taskcontinues executing..IP (2)If the semaphore is empty, the task will be blocked, pending theavailability of the semaphore.  If a timeout is specified and the timeoutexpires, the pended task will be removed from the queue of pended tasksand enter the ready state with an ERROR status.  A pended taskis ineligible for CPU allocation.  Any number of tasks may be pendedsimultaneously on the same binary semaphore..LPWhen a task gives a binary semaphore, using semGive(), the next availabletask in the pend queue is unblocked.  If no task is pending on thissemaphore, the semaphore becomes full.  Note that if a semaphore is given,and a task is unblocked that is of higher priority than the task that calledsemGive(), the unblocked task will preempt the calling task.MUTUAL EXCLUSIONTo use a binary semaphore as a means of mutual exclusion, first create itwith an initial state of full.  For example:.CS.ne 4    SEM_ID semMutex;    /@ create a binary semaphore that is initially full @/    semMutex = semBCreate (SEM_Q_PRIORITY, SEM_FULL);.CEThen guard a critical section or resource by taking the semaphore withsemTake(), and exit the section or release the resource by givingthe semaphore with semGive().  For example:.CS.ne 4    semTake (semMutex, WAIT_FOREVER);        ...  /@ critical region, accessible only by one task at a time @/        semGive (semMutex);.CEWhile there is no restriction on the same semaphore being given, taken, orflushed by multiple tasks, it is important to ensure the properfunctionality of the mutual-exclusion construct.  While there is no dangerin any number of processes taking a semaphore, the giving of a semaphoreshould be more carefully controlled.  If a semaphore is given by a task thatdid not take it, mutual exclusion could be lost.SYNCHRONIZATIONTo use a binary semaphore as a means of synchronization, create itwith an initial state of empty.  A task blocks by taking a semaphoreat a synchronization point, and it remains blocked until the semaphore is givenby another task or interrupt service routine.Synchronization with interrupt service routines is a particularly common need.Binary semaphores can be given, but not taken, from interrupt level.  Thus, atask can block at a synchronization point with semTake(), and an interruptservice routine can unblock that task with semGive().In the following example, when init() is called, the binary semaphore iscreated, an interrupt service routine is attached to an event, and a taskis spawned to process the event.  Task 1 will run until it calls semTake(),at which point it will block until an event causes the interrupt serviceroutine to call semGive().  When the interrupt service routine completes,task 1 can execute to process the event..CS.ne 8    SEM_ID semSync;    /@ ID of sync semaphore @/    init ()	{	intConnect (..., eventInterruptSvcRout, ...);	semSync = semBCreate (SEM_Q_FIFO, SEM_EMPTY);	taskSpawn (..., task1);	}.ne 6    task1 ()	{	...	semTake (semSync, WAIT_FOREVER);    /@ wait for event @/	...    /@ process event @/	}.ne 6    eventInterruptSvcRout ()	{	...	semGive (semSync);    /@ let task 1 process event @/	...	}.CEA semFlush() on a binary semaphore will atomically unblock all pendedtasks in the semaphore queue, i.e., all tasks will be unblocked at once,before any actually execute.CAVEATSThere is no mechanism to give back or reclaim semaphores automatically whentasks are suspended or deleted.  Such a mechanism, though desirable, is notcurrently feasible.  Without explicit knowledge of the state of the guardedresource or region, reckless automatic reclamation of a semaphore couldleave the resource in a partial state.  Thus, if a task ceases executionunexpectedly, as with a bus error, currently owned semaphores will not begiven back, effectively leaving a resource permanently unavailable.  Themutual-exclusion semaphores provided by semMLib offer protection fromunexpected task deletion.INTERNAL:	WINDVIEW INSTRUMENTATIONLevel 1:	semBCreate() causes EVENT_SEMBCREATELevel 2 (portable only):	semGive() causes EVENT_OBJ_SEMGIVE	semTake() causes EVENT_OBJ_SEMTAKELevel 3:	N/AINCLUDE FILES: semLib.hSEE ALSO: semLib, semCLib, semMLib,.pG "Basic OS"*/#include "vxWorks.h"#include "errno.h"#include "taskLib.h"#include "intLib.h"#include "errnoLib.h"#include "eventLib.h"#include "private/eventLibP.h"#include "private/sigLibP.h"#include "private/objLibP.h"#include "private/semLibP.h"#include "private/windLibP.h"#include "private/eventP.h"/* optimized version available for 680X0, MIPS, I80X86, SH, *//* COLDFIRE, 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 semBLib_PORTABLE#endif/* locals */LOCAL BOOL	semBLibInstalled;		/* protect from muliple inits *//********************************************************************************* semBLibInit - initialize the binary semaphore management package* * SEE ALSO: semLibInit(1).* NOMANUAL*/STATUS semBLibInit (void)    {    if (!semBLibInstalled)	{	semGiveTbl [SEM_TYPE_BINARY]		= (FUNCPTR) semBGive;	semTakeTbl [SEM_TYPE_BINARY]		= (FUNCPTR) semBTake;	semFlushTbl [SEM_TYPE_BINARY]		= (FUNCPTR) semQFlush;	semGiveDeferTbl [SEM_TYPE_BINARY]	= (FUNCPTR) semBGiveDefer;	semFlushDeferTbl [SEM_TYPE_BINARY]	= (FUNCPTR) semQFlushDefer;	if (semLibInit () == OK)	    semBLibInstalled = TRUE;	}    return ((semBLibInstalled) ? OK : ERROR);    }/********************************************************************************* semBCreate - create and initialize a binary semaphore** This routine allocates and initializes a binary semaphore.  The semaphore* is initialized to the <initialState> of either SEM_FULL (1) or SEM_EMPTY (0).** The <options> parameter specifies the queuing style for blocked tasks.* Tasks can be queued on a priority basis or a first-in-first-out basis.* These options are SEM_Q_PRIORITY (0x1) and SEM_Q_FIFO (0x0), respectively.* That parameter also specifies if semGive() should return ERROR when* the semaphore fails to send events. This option is turned off by default;* it is activated by doing a bitwise-OR of SEM_EVENTSEND_ERR_NOTIFY (0x10)* with the queuing style of the semaphore.*** RETURNS: The semaphore ID, or NULL if memory cannot be allocated.*/SEM_ID semBCreate    (    int         options,                /* semaphore options */    SEM_B_STATE initialState            /* initial semaphore state */    )    {    SEM_ID semId;    if ((!semBLibInstalled) && (semBLibInit () != OK))	/* initialize package */	return (NULL);    if ((semId = (SEM_ID) objAlloc (semClassId)) == NULL)	return (NULL);    /* initialize allocated semaphore */    if (semBInit (semId, options, initialState) != OK)	{	objFree (semClassId, (char *) semId);	return (NULL);	}#ifdef WV_INSTRUMENTATION    /* windview - level 1 event logging */    EVT_OBJ_3 (OBJ, semId, semClassId,	       EVENT_SEMBCREATE, semId, options, semId->state);#endif    return (semId);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲自拍偷拍麻豆| 成人免费高清视频| 亚洲午夜电影网| 亚洲欧美另类综合偷拍| 亚洲欧洲av一区二区三区久久| 国产午夜亚洲精品理论片色戒| 久久久久久免费| 久久品道一品道久久精品| 精品国产污污免费网站入口| 精品美女被调教视频大全网站| 欧美电影免费观看高清完整版在 | 欧美一级片免费看| 制服.丝袜.亚洲.另类.中文 | 日韩av不卡在线观看| 日本中文一区二区三区| 美女视频一区在线观看| 久久精品国产第一区二区三区| 九九热在线视频观看这里只有精品| 精品一区二区三区久久久| 国产又粗又猛又爽又黄91精品| 成人午夜伦理影院| 色吊一区二区三区| 91精品国产一区二区人妖| 欧美成人艳星乳罩| 国产精品乱码一区二区三区软件| 日韩理论在线观看| 婷婷成人激情在线网| 精品亚洲成a人| 99re热视频这里只精品 | 亚洲自拍都市欧美小说| 午夜精品一区二区三区三上悠亚| 日韩在线一二三区| 国产麻豆视频精品| 一本色道久久综合亚洲aⅴ蜜桃| 欧美日韩国产电影| 精品88久久久久88久久久| 亚洲欧洲在线观看av| 天天av天天翘天天综合网色鬼国产 | 国产精品久久久久久久久搜平片| 亚洲精品乱码久久久久久久久| 日韩黄色小视频| 成人精品一区二区三区中文字幕| 欧美唯美清纯偷拍| 久久精品在线观看| 亚洲福利一二三区| 丁香六月综合激情| 4438成人网| 国产精品素人一区二区| 午夜精品久久久久久久久 | 久久久久久夜精品精品免费| 亚洲视频小说图片| 九色综合国产一区二区三区| 99vv1com这只有精品| 欧美成人免费网站| 一二三四社区欧美黄| 国产精品一二三四五| 欧美挠脚心视频网站| 中文字幕不卡在线播放| 日韩av中文字幕一区二区| 91女厕偷拍女厕偷拍高清| 精品免费视频一区二区| 亚洲综合精品久久| 粉嫩av亚洲一区二区图片| 7777精品伊人久久久大香线蕉完整版 | 国产亚洲一区字幕| 日韩专区一卡二卡| 91小视频在线观看| 久久久精品天堂| 免费观看在线色综合| 欧美亚洲一区二区在线| 中文字幕第一区二区| 伦理电影国产精品| 欧美特级限制片免费在线观看| 欧美国产精品中文字幕| 精久久久久久久久久久| 欧美老女人第四色| 亚洲精品写真福利| 成人av第一页| 久久久午夜电影| 美女国产一区二区| 91精品国产综合久久久久久久久久| 亚洲视频免费在线观看| 国产mv日韩mv欧美| 欧美精品一区二区高清在线观看| 日韩精品电影一区亚洲| 在线一区二区三区| 亚洲日本中文字幕区| 成人精品国产免费网站| 国产亚洲欧美在线| 精品一区二区免费看| 91精品国产综合久久香蕉的特点| 亚洲午夜电影网| 欧美视频在线一区| 一级做a爱片久久| 色欧美88888久久久久久影院| 国产精品久久久久一区| 成人一级视频在线观看| 国产调教视频一区| 丁香啪啪综合成人亚洲小说 | 久热成人在线视频| 日韩一级欧美一级| 蜜臀a∨国产成人精品| 日韩写真欧美这视频| 日韩av不卡一区二区| 欧美一区二区三区免费大片 | 91丝袜国产在线播放| 亚洲天堂成人网| 一本一道久久a久久精品综合蜜臀| 亚洲欧美日韩国产综合| 日本高清视频一区二区| 亚洲一区二区三区中文字幕| 欧美性xxxxx极品少妇| 午夜不卡av免费| 日韩欧美一区在线| 国产一区二区导航在线播放| 国产三级精品视频| 91污片在线观看| 亚洲一区在线视频| 51久久夜色精品国产麻豆| 久久成人精品无人区| 国产无人区一区二区三区| av一本久道久久综合久久鬼色| 综合自拍亚洲综合图不卡区| 欧美主播一区二区三区美女| 午夜精品福利一区二区三区av| 日韩一级免费一区| 成人午夜精品一区二区三区| 亚洲欧美综合色| 欧美日本在线观看| 久久99精品一区二区三区| 欧美国产日产图区| 欧美天堂一区二区三区| 麻豆91精品视频| 欧美国产精品专区| 欧美吻胸吃奶大尺度电影| 久久99精品一区二区三区| 综合亚洲深深色噜噜狠狠网站| 欧美日韩在线播放三区四区| 精品一区二区影视| 《视频一区视频二区| 欧美一区二区三区系列电影| 国产精品影视网| 香蕉影视欧美成人| 国产拍欧美日韩视频二区| 欧美亚洲图片小说| 国产麻豆视频一区二区| 亚洲一区二区精品3399| 337p粉嫩大胆色噜噜噜噜亚洲 | 国产亚洲女人久久久久毛片| 在线一区二区三区四区| 激情文学综合丁香| 一区二区三区色| 久久日一线二线三线suv| 色先锋资源久久综合| 老色鬼精品视频在线观看播放| 成人欧美一区二区三区视频网页 | 日韩欧美成人一区二区| 成人av网在线| 美女一区二区久久| 一区二区三区免费网站| 久久久久久**毛片大全| 欧美三片在线视频观看 | 国产精品久久久久一区二区三区共 | 在线视频一区二区三| 国产一区91精品张津瑜| 性久久久久久久| 亚洲天堂久久久久久久| 久久久久久夜精品精品免费| 欧美日产在线观看| 日本伦理一区二区| 国产乱一区二区| 美国十次了思思久久精品导航| 亚洲精品中文字幕在线观看| 久久九九国产精品| 日韩色视频在线观看| 欧美在线观看视频一区二区三区| 国产一区高清在线| 日韩和欧美的一区| 亚洲一区二区av电影| 国产精品电影一区二区| 国产亚洲综合在线| 欧美变态tickle挠乳网站| 欧美日本在线视频| 欧美性生活大片视频| 一本色道久久综合亚洲91| 不卡av在线免费观看| 国产一区二区三区香蕉| 强制捆绑调教一区二区| 天天爽夜夜爽夜夜爽精品视频| 亚洲精品日日夜夜| 国产精品理论片| 中文字幕不卡的av| 欧美激情中文字幕| 欧美国产禁国产网站cc| 久久蜜桃av一区精品变态类天堂| 日韩一区二区影院| 欧美成人精精品一区二区频| 5566中文字幕一区二区电影| 欧美丰满高潮xxxx喷水动漫| 欧美精品丝袜中出|