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

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

?? semblib.c

?? vxwork源代碼
?? 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午夜电影| 日韩精品成人一区二区在线| 欧美高清在线视频| 日韩一区二区电影| 99热99精品| 狠狠色丁香久久婷婷综| 午夜精品久久久久久久| 亚洲视频在线一区| 国产欧美一区二区三区鸳鸯浴 | 欧美午夜片在线看| 成人免费视频caoporn| 青青草国产精品97视觉盛宴| 亚洲欧洲综合另类在线| 久久久美女艺术照精彩视频福利播放| 欧美午夜不卡视频| 99久久99久久精品免费看蜜桃 | 欧美丝袜丝nylons| www.色精品| 国产精品夜夜嗨| 男男视频亚洲欧美| 日本女优在线视频一区二区| 国产精品人成在线观看免费 | 色综合久久综合中文综合网| 久久99精品久久久久久| 日韩精品成人一区二区三区| 一区二区三区欧美亚洲| ...xxx性欧美| 中文字幕人成不卡一区| 国产精品嫩草影院av蜜臀| 日韩一区二区在线看片| 欧美一区永久视频免费观看| 欧美日韩一区二区三区四区| 91国产免费看| 91极品视觉盛宴| 欧美在线观看你懂的| 欧美这里有精品| 欧美三级日韩三级| 欧美日韩一区二区三区四区 | 奇米色777欧美一区二区| 性做久久久久久免费观看欧美| 亚洲精品国久久99热| 伊人色综合久久天天人手人婷| 伊人色综合久久天天| 亚洲免费在线播放| 一区二区三区 在线观看视频 | 免费不卡在线视频| 美女免费视频一区二区| 久久91精品国产91久久小草| 狠狠色丁香久久婷婷综合_中| 国产一区二区剧情av在线| 国产一区二区三区四| 丰满少妇在线播放bd日韩电影| 成人性生交大片免费看中文| 91麻豆国产在线观看| 在线视频亚洲一区| 91精品国产一区二区三区蜜臀| 这里只有精品视频在线观看| 久久综合九色综合97婷婷| 国产日韩av一区二区| 中文字幕在线一区免费| 亚洲成人在线网站| 精一区二区三区| 不卡av在线免费观看| 欧美色综合影院| 日韩亚洲欧美在线| 日本一区二区三区免费乱视频| 日韩理论片中文av| 午夜欧美大尺度福利影院在线看| 精品一区二区三区免费视频| 激情久久五月天| 97精品国产露脸对白| 91麻豆精品国产91久久久| 久久久综合精品| 亚洲欧美激情插| 久久99久久99小草精品免视看| 高清免费成人av| 欧美日韩不卡一区二区| 久久精品一区二区| 亚洲一区自拍偷拍| 国内精品国产三级国产a久久| 91网页版在线| 欧美刺激脚交jootjob| 一区在线播放视频| 五月天激情综合| 91小宝寻花一区二区三区| 欧美日韩国产美| 国产精品福利一区二区| 首页亚洲欧美制服丝腿| 成人一道本在线| 日韩一二在线观看| 玉足女爽爽91| 成人午夜激情在线| 日韩一级在线观看| 亚洲男人天堂av| 国产91丝袜在线播放| 91精品国产福利| 一区二区三区在线观看欧美| 久久精品国产久精国产爱| 99re在线视频这里只有精品| www国产精品av| 蜜臀av在线播放一区二区三区| 94-欧美-setu| 国产精品毛片大码女人| 激情五月婷婷综合网| 欧美高清hd18日本| 亚洲精品免费在线播放| 成人app网站| 国产欧美一区二区精品婷婷| 青娱乐精品视频| 欧美日韩免费电影| 亚洲精品国产一区二区精华液 | 日韩**一区毛片| 欧美色图一区二区三区| 亚洲欧洲成人精品av97| 国产一区二区三区电影在线观看| 4438x成人网最大色成网站| 一区二区免费在线播放| 91色乱码一区二区三区| 国产精品久久久久久久第一福利| 国产老妇另类xxxxx| 欧美电影免费观看高清完整版| 丝袜美腿亚洲色图| 欧美日韩三级在线| 亚洲一区二区三区爽爽爽爽爽 | 99视频在线精品| 国产精品久久久久久久岛一牛影视| 国产一区二区三区综合| 久久综合久久综合九色| 久久精工是国产品牌吗| 日韩小视频在线观看专区| 日韩高清在线不卡| 欧美一区二区私人影院日本| 午夜激情一区二区三区| 欧美色图天堂网| 日本伊人午夜精品| 日韩欧美一区在线| 国内欧美视频一区二区| 国产香蕉久久精品综合网| 国产一区二区免费在线| 欧美国产一区视频在线观看| 成人免费的视频| 亚洲人成网站精品片在线观看| 91网址在线看| 亚洲成av人片一区二区| 欧美老肥妇做.爰bbww| 日本亚洲免费观看| 精品裸体舞一区二区三区| 国产一区二区三区四区五区美女| 欧美经典三级视频一区二区三区| k8久久久一区二区三区| 有码一区二区三区| 欧美一区二区三区视频在线| 国产在线国偷精品免费看| 中文字幕av免费专区久久| 色婷婷激情久久| 日本女优在线视频一区二区| 久久精品视频一区二区| 99久久伊人网影院| 亚洲一本大道在线| 日韩一级成人av| zzijzzij亚洲日本少妇熟睡| 亚洲一区二区高清| 日韩美女在线视频 | 国产剧情av麻豆香蕉精品| 欧美国产精品中文字幕| 日本韩国一区二区| 热久久免费视频| 中文天堂在线一区| 欧美精品免费视频| 国产成人精品免费一区二区| 亚洲午夜久久久久久久久电影网| 欧美大度的电影原声| 91免费看视频| 美女视频第一区二区三区免费观看网站| 欧美激情一区三区| 欧美日本在线视频| 高清不卡一区二区| 手机精品视频在线观看| 国产精品三级av在线播放| 欧美天堂亚洲电影院在线播放| yourporn久久国产精品| 蜜桃精品视频在线| 亚洲天堂精品视频| 日韩精品一区国产麻豆| 色香色香欲天天天影视综合网| 美女在线视频一区| 一区二区三区在线观看视频| 久久精品一区蜜桃臀影院| 欧美日韩一级黄| 成人高清视频在线| 久久国产精品一区二区| 亚洲精选免费视频| 欧美激情中文字幕一区二区| 日韩一区二区影院| 欧美亚日韩国产aⅴ精品中极品| 懂色中文一区二区在线播放| 麻豆精品一区二区|