您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DosWaitEventSem函数代码示例

51自学网 2021-06-01 20:29:44
  C++
这篇教程C++ DosWaitEventSem函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DosWaitEventSem函数的典型用法代码示例。如果您正苦于以下问题:C++ DosWaitEventSem函数的具体用法?C++ DosWaitEventSem怎么用?C++ DosWaitEventSem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DosWaitEventSem函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: getmessage

int getmessage (int interval){    int             key = 0;    ULONG           posted;    if (que_n() > 0) return que_get ();        // with interval == 0, we only check for keys in buffer    if (interval == 0)    {        key = 0;    }    else if (interval > 0)    {        DosResetEventSem (hev_NewMessage, &posted);        DosWaitEventSem (hev_NewMessage, interval);        key = que_get ();    }    else if (interval < 0)    {        DosResetEventSem (hev_NewMessage, &posted);        DosWaitEventSem (hev_NewMessage, SEM_INDEFINITE_WAIT);        key = que_get ();    }    return key;}
开发者ID:OS2World,项目名称:LIB-libfly,代码行数:26,


示例2: PipeWaitAndResetEventSem

static APIRET PipeWaitAndResetEventSem(HEV *SemHandle){#define EVENTSEM_TIMEOUT SEM_INDEFINITE_WAIT	APIRET rc;	ULONG PostCt;	rc = DosWaitEventSem(*SemHandle, EVENTSEM_TIMEOUT);	if (!rc) rc = DosResetEventSem(*SemHandle, &PostCt);	if (rc == ERROR_INVALID_HANDLE)	{		rc = DosOpenEventSem(0, SemHandle);		if (!rc) 		{		    rc = DosWaitEventSem(*SemHandle, EVENTSEM_TIMEOUT);		    if (!rc) rc = DosResetEventSem(*SemHandle, &PostCt);		}	}        if (rc == ERROR_ALREADY_RESET) rc = 0;	return rc;}
开发者ID:OS2World,项目名称:UTIL-MEMORY-MemLink,代码行数:25,


示例3: ThreadConsumer

/****************************************************************/ * Routine for consumer threads.                                * *--------------------------------------------------------------* *                                                              * *  Name:     ThreadConsumer(PVOID)                             * *                                                              * *  Purpose:  There are NUMUSERS copies of this thread to act   * *            as consumers of the resource. The thread waits for* *            exclusive access to the resource and colors it.   * *                                                              * *  Usage:    Threads created by StartSemExample.               * *                                                              * *  Method:   Waits for mutex to gain ownership of resource.    * *            Releases resource when user event. Dies when      * *            Stop event.                                       * *  Returns:                                                    * *                                                              */****************************************************************/VOID ThreadConsumer( PVOID pvMyID ){   ULONG  ulPostCnt;   ULONG  ulUser=0L;   ULONG  rc;   HAB    habb;   HMQ    hmqq;   /* Need a message queue for any thread that wants to print messages. */   habb = WinInitialize(0);   hmqq = WinCreateMsgQueue(habb,0);   /* while the user has not selected stop ... */   while ((DosWaitEventSem(hevStop,SEM_IMMEDIATE_RETURN)) == ERROR_TIMEOUT)   {      /* Wait for exclusive ownership of resource */      DosRequestMutexSem(hmtxOwnResource,SEM_INDEFINITE_WAIT);      /* the following check is necessary because the stop semaphore       * may have been posted  while we were waiting on the mutex       */      if (DosWaitEventSem(hevStop, SEM_IMMEDIATE_RETURN) == ERROR_TIMEOUT)      {      /*********************************************************************/       * an item is ready, which one?  don't wait forever because there is *       * a possibility that the stop semaphore was posted and that no more *       * resource is forthcoming. we wait twice as long as we think is     *       * necessary.                                                        *      /*********************************************************************/         if (!DosWaitMuxWaitSem (hmuxResource, max (ulTimeout << 1,            TIMEOUTPERIOD) , &ulUser))         {            MyMove ((ULONG) pvMyID, ulUser);            DosResetEventSem(aSquares[ulUser].hev, &ulPostCnt);         }      }                               /* Let some other thread have resource. */      rc = DosReleaseMutexSem(hmtxOwnResource);      if (rc)      {         SemError("DosReleaseMutexSem",rc);      }   }   /* hevStop was posted, kill this thread */   WinDestroyMsgQueue (hmqq);   WinTerminate (habb);   DosExit(EXIT_THREAD, 0);   return;}
开发者ID:MbqIIB,项目名称:DEV-SAMPLES-IBM_Dev_Toolkit_Samples,代码行数:68,


示例4: assert

	/* virtual */ void WaitForSignal()	{		assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise?		this->EndCritical();		DosWaitEventSem(event, SEM_INDEFINITE_WAIT);		this->BeginCritical();	}
开发者ID:Latexi95,项目名称:openttd,代码行数:7,


示例5: SysWaitEventSem

unsigned long SysWaitEventSem(unsigned char *name,                           unsigned long numargs,                           RXSTRING args[],                           char *queuename,                           RXSTRING *retstr){    unsigned long rc;    unsigned long timeout = SEM_INDEFINITE_WAIT; /* timeout value default */    HEV handle = NULL;           /* mutex handle */#ifdef DLOGGING    logmessage(__func__);#endif    if (numargs < 1 || numargs > 2 || !RXVALIDSTRING(args[0]))        return INVALID_ROUTINE;    if (numargs == 2) {        if (!string2ulong(args[1].strptr, &timeout)) return INVALID_ROUTINE;    }    if (!string2ulong(args[0].strptr, &handle)) return INVALID_ROUTINE;    rc = DosWaitEventSem(handle, timeout);    RETVAL(rc)}
开发者ID:OS2World,项目名称:LIB-REXX-REXX_Utilities,代码行数:28,


示例6: avcodec_thread_execute

int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){    ThreadContext *c= s->thread_opaque;    int i;    assert(s == c->avctx);    assert(count <= s->thread_count);    /* note, we can be certain that this is not called with the same AVCodecContext by different threads at the same time */    for(i=0; i<count; i++){        c[i].arg= (char*)arg + i*size;        c[i].func= func;        c[i].ret= 12345;        DosPostEventSem(c[i].work_sem);//        ReleaseSemaphore(c[i].work_sem, 1, 0);    }    for(i=0; i<count; i++){        DosWaitEventSem(c[i].done_sem,SEM_INDEFINITE_WAIT);//        WaitForSingleObject(c[i].done_sem, INFINITE);        c[i].func= NULL;        if(ret) ret[i]= c[i].ret;    }    return 0;}
开发者ID:Acidburn0zzz,项目名称:ffmpeg-concat,代码行数:27,


示例7: Os2_wait_async_info

/* wait_async_info waits for some handles to become ready. This function * returns if at least one handle becomes ready. * A handle can be added with add_async_waiter to the bundle of handles to * wait for. * No special handling is implemented if an asyncronous interrupt occurs. * Thus, there is no guarantee to have handle which works. */static void Os2_wait_async_info(void *async_info){   AsyncInfo *ai = async_info;   if (ai->mustwait)      DosWaitEventSem(ai->sem, SEM_INDEFINITE_WAIT);}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:14,


示例8: GetClipText

int GetClipText(ClipData *cd) {    int rc;    ULONG PostCount;    char *mem;        rc = DosOpenMutexSem(SEM_PREFIX "CLIPSYN", &hmtxSyn);    if (rc != 0) return -1;    rc = DosOpenEventSem(SEM_PREFIX "CLIPGET", &hevGet);    if (rc != 0) return -1;/*    rc = DosOpenEventSem(SEM_PREFIX "CLIPPUT", &hevPut);*//*    if (rc != 0) return -1;*/    rc = DosOpenEventSem(SEM_PREFIX "CLIPEND", &hevEnd);    if (rc != 0) return -1;        DosRequestMutexSem(hmtxSyn, SEM_INDEFINITE_WAIT);    DosResetEventSem(hevEnd, &PostCount);    DosPostEventSem(hevGet);    DosWaitEventSem(hevEnd, SEM_INDEFINITE_WAIT);    if (0 == DosGetNamedSharedMem((void **)&mem, MEM_PREFIX "CLIPDATA", PAG_READ | PAG_WRITE)) {        cd->fLen = *(ULONG*)mem;        cd->fChar = strdup(mem + 4);        DosFreeMem(mem);    } else {        cd->fLen = 0;        cd->fChar = 0;    }    DosPostEventSem(hevGet);    DosReleaseMutexSem(hmtxSyn);/*    DosCloseEventSem(hevPut);*/    DosCloseEventSem(hevGet);    DosCloseEventSem(hevEnd);    DosCloseMutexSem(hmtxSyn);    return 0;}
开发者ID:OS2World,项目名称:APP-EDITOR-fte,代码行数:34,


示例9: ThdDskPerf

VOID APIENTRY ThdDskPerf( ULONG ulTask ){  int k;  PDTV pDisk;  pDisk = (PDTV)ulTask;  pDisk->szDir[ 6 ] = (char)( pDisk->ulTask + 0x30 );  pDisk->szDir[ 7 ] = 0;  setdisk( (int)( pDisk->szDrive[ 0 ] - 'A' ) );  mkdir( pDisk->szDir );  chdir( pDisk->szDir );  /* create test files */  DosPostEventSem( pDisk->hevReady );  /* start timing */  DosWaitEventSem( hevGo, SEM_INDEFINITE_WAIT );  /* perform string of file operations */  for( k = 0; k < ITER; k++ )    readswrites( pDisk );  /*stop timimg*/  EndItAll( 0, pDisk );}
开发者ID:OS2World,项目名称:UTIL-BENCHMARK-MDisk,代码行数:27,


示例10: Open

/** * This function initializes KVA vout method. */static int Open ( vlc_object_t *object ){    vout_display_t *vd = (vout_display_t *)object;    vout_display_sys_t *sys;    vd->sys = sys = calloc( 1, sizeof( *sys ));    if( !sys )        return VLC_ENOMEM;    DosCreateEventSem( NULL, &sys->ack_event, 0, FALSE );    sys->tid = _beginthread( PMThread, NULL, 1024 * 1024, vd );    DosWaitEventSem( sys->ack_event, SEM_INDEFINITE_WAIT );    if( sys->i_result != VLC_SUCCESS )    {        DosCloseEventSem( sys->ack_event );        free( sys );        return VLC_EGENERIC;    }    return VLC_SUCCESS;}
开发者ID:fabsther,项目名称:vlc-mort,代码行数:28,


示例11: DosRequestMutexSem

void omni_condition::wait(void){    _internal_omni_thread_helper me;    DosRequestMutexSem( crit , SEM_INDEFINITE_WAIT );    me->cond_next = NULL;    me->cond_prev = waiting_tail;    if (waiting_head == NULL)    waiting_head = me;    else    waiting_tail->cond_next = me;    waiting_tail = me;    me->cond_waiting = TRUE;    DosReleaseMutexSem( crit );    mutex->unlock();    APIRET result =  DosWaitEventSem(me->cond_semaphore, SEM_INDEFINITE_WAIT);    ULONG c;    DosResetEventSem(me->cond_semaphore,&c);    mutex->lock();    if (result != 0) throw omni_thread_fatal(result);}
开发者ID:OS2World,项目名称:APP-INTERNET-PMVNC-Server,代码行数:27,


示例12: while

void TEventQueue::keyboardThread( void * arg ) {  arg = arg;  KBDKEYINFO *info = &TThreads::tiled->keyboardInfo;  while (1) {    jsSuspendThread    USHORT errCode = KbdCharIn( info, IO_NOWAIT, 0 );    jsSuspendThread    if ( errCode || (info->fbStatus & 0xC0)!=0x40 || info->fbStatus & 1) { // no char      keyboardEvent.what = evNothing;      DosSleep(keyboardPollingDelay);      if (keyboardPollingDelay < 500) keyboardPollingDelay += 5;    } else {    keyboardEvent.what = evKeyDown;    if ((info->fbStatus & 2) && (info->chChar==0xE0)) info->chChar=0; // OS/2 cursor keys.    keyboardEvent.keyDown.charScan.charCode=info->chChar;    keyboardEvent.keyDown.charScan.scanCode=info->chScan;    shiftState = info->fsState & 0xFF;    jsSuspendThread    assert(! DosPostEventSem(TThreads::hevKeyboard1) );    jsSuspendThread    assert(! DosWaitEventSem(TThreads::hevKeyboard2, SEM_INDEFINITE_WAIT) );    keyboardEvent.what = evNothing;    ULONG dummy;    jsSuspendThread    assert(! DosResetEventSem(TThreads::hevKeyboard2, &dummy) );    keyboardPollingDelay=0;    }  }  TThreads::deadEnd();}
开发者ID:hackshields,项目名称:antivirus,代码行数:35,


示例13: pthread_cond_timedwait

int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,			   struct timespec *abstime){  struct timeb curtime;  int result;  long timeout;   APIRET   rc;   int	    rval;   _ftime(&curtime);   timeout= ((long) (abstime->ts_sec - curtime.time)*1000L +		    (long)((abstime->ts_nsec/1000) - curtime.millitm)/1000L);   if (timeout < 0)				/* Some safety */      timeout = 0L;   rval = 0;   cond->waiting++;   if (mutex) pthread_mutex_unlock(mutex);   rc = DosWaitEventSem(cond->semaphore, timeout);   if (rc != 0)      rval = ETIME;   if (mutex) pthread_mutex_lock(mutex);   cond->waiting--;   return rval;}
开发者ID:OPSF,项目名称:uClinux,代码行数:30,


示例14: __CBeginThread

int __CBeginThread( thread_fn *start_addr, void *stack_bottom,                    unsigned stack_size, void *arglist )/******************************************************/{    TID         tid;    APIRET      rc;    thread_args td;    if( __ThreadData == NULL ) {        if( __InitThreadProcessing() == NULL )  return( -1 );        __InitMultipleThread();    }    stack_bottom = stack_bottom;    td.rtn = start_addr;    td.argument = arglist;    rc = DosCreateEventSem( NULL, &td.event, 0, 0 );    if( rc != 0 ) return( -1 );    rc = DosCreateThread( &tid, (PFNTHREAD)begin_thread_helper, (ULONG)&td,                          0, stack_size + __threadstksize );    if( rc != 0 ) {        tid = -1;    } else {        /*           suspend parent thread so that it can't call _beginthread() again           before new thread extracts data from "td" (no problem if new           thread calls _beginthread() since it has its own stack)        */        DosWaitEventSem( td.event, SEM_INDEFINITE_WAIT );    }    DosCloseEventSem( td.event );    return( tid );}
开发者ID:bhanug,项目名称:open-watcom-v2,代码行数:32,


示例15: DosWaitEventSem

void omni_semaphore::wait(void){    ULONG cnt;    APIRET rc = DosWaitEventSem(nt_sem, SEM_INDEFINITE_WAIT);    if (rc != 0)    throw omni_thread_fatal(rc);    DosResetEventSem(nt_sem,&cnt);}
开发者ID:OS2World,项目名称:APP-INTERNET-PMVNC-Server,代码行数:8,


示例16: BeginSoftModeThread

static void BeginSoftModeThread( thread_data *arglist ){    TID         tid;    ULONG       ulCount;    DosResetEventSem( BeginThreadSem , &ulCount );    DosCreateThread( &tid, BeginThreadHelper, (ULONG)arglist, 0, STACK_SIZE );    DosWaitEventSem( BeginThreadSem, SEM_INDEFINITE_WAIT );}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:9,


示例17: ReadLoopThread

void APIENTRY ReadLoopThread()  {  THREAD *pstThd = pstThread;  CONFIG *pCfg = &pstThd->stCfg;  THREADCTRL *pThread = &pstThd->stThread;  BOOL bReadComplete;  CHAR *pString;  APIRET rc;  BOOL bSkipRead = FALSE;  char szMessage[80];  ULONG ulStringLength;  ULONG ulPostCount;//  DosSetPriority(PRTYS_THREAD,PRTYC_FOREGROUNDSERVER,-28L,0);  DosSetPriority(PRTYS_THREAD,PRTYC_REGULAR,-10L,0);  ulStringLength = pCfg->wReadStringLength;  DosAllocMem((PPVOID)&pString,10010,(PAG_COMMIT | PAG_WRITE | PAG_READ));  while (!pThread->bStopThread)    {    if (ulStringLength != pCfg->wReadStringLength)      {      DosFreeMem(pString);      ulStringLength = pCfg->wReadStringLength;      DosAllocMem((PPVOID)&pString,(ulStringLength + 10),(PAG_COMMIT | PAG_WRITE | PAG_READ));      }    if (pCfg->bHalfDuplex)      {      while ((rc = DosWaitEventSem(hevStartReadSem,10000)) != 0)        if (rc == ERROR_SEM_TIMEOUT)          {          ErrorNotify(pstThd,"Read start semaphore timed out");          bSkipRead = TRUE;          }        else          {          sprintf(szMessage,"Read start semaphore error - rc = %u",rc);          ErrorNotify(pstThd,szMessage);          }      DosResetEventSem(hevStartReadSem,&ulPostCount);      }    if (bSkipRead)      bSkipRead = FALSE;    else      {      if (!pCfg->bReadCharacters)        bReadComplete = ReadString(pstThd,pString);      else        bReadComplete = ReadCharacters(pstThd,pString);      if (bReadComplete)        DosPostEventSem(hevStartWriteSem);      }    }  DosFreeMem(pString);  DosPostEventSem(hevKillReadThreadSem);  DosExit(EXIT_THREAD,0);  }
开发者ID:OS2World,项目名称:APP-COMM-ComScope,代码行数:57,


示例18: write_os2

static int write_os2(audio_output_t *ao,unsigned char *buf,int len){	/* if we're too quick, let's wait */	if(nobuffermode)	{		MCI_MIX_BUFFER *temp = playingbuffer;				while(			(tobefilled != (temp = ((BUFFERINFO *) temp->ulUserParm)->NextBuffer)) &&			(tobefilled != (temp = ((BUFFERINFO *) temp->ulUserParm)->NextBuffer)) &&			(tobefilled != (temp = ((BUFFERINFO *) temp->ulUserParm)->NextBuffer)) )		{			DosResetEventSem(dataplayed,&resetcount);			DosWaitEventSem(dataplayed, -1);			temp = playingbuffer;		}			} else {		while(tobefilled == playingbuffer)		{			DosResetEventSem(dataplayed,&resetcount);			DosWaitEventSem(dataplayed, -1);		}	}			if (justflushed) {		justflushed = FALSE;	} else {		nomoredata = FALSE;				memcpy(tobefilled->pBuffer, buf, len);		tobefilled->ulBufferLength = len;		//      ((BUFFERINFO *) tobefilled->ulUserParm)->frameNum = fr->frameNum;				/* if we're out of the water (3rd ahead buffer filled),		let's reduce our priority */		if(tobefilled == ( (BUFFERINFO *) ( (BUFFERINFO *) ((BUFFERINFO *) playingbuffer->ulUserParm)->NextBuffer->ulUserParm)->NextBuffer->ulUserParm)->NextBuffer)			DosSetPriority(PRTYS_THREAD,normalclass,normaldelta,mainthread->tib_ptib2->tib2_ultid);				tobefilled = ((BUFFERINFO *) tobefilled->ulUserParm)->NextBuffer;	}		return len;}
开发者ID:IreneKnapp,项目名称:Emerald-Frame,代码行数:44,


示例19: _PR_MD_TIMED_WAIT_SEM

PRStatus_PR_MD_TIMED_WAIT_SEM(_MDSemaphore *md, PRIntervalTime ticks){    int rv;    rv = DosWaitEventSem(md->sem, PR_IntervalToMilliseconds(ticks));    if (rv == NO_ERROR)        return PR_SUCCESS;    else        return PR_FAILURE;}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.external,代码行数:11,


示例20: wait_post

static ULONGwait_post(ULONG ulTimeOut){	ULONG count = 0;	ULONG rc;					/* return value *//*	rc = DosWaitEventSem(postSema, -1);*/		/* wait forever*/	rc = DosWaitEventSem(postSema, ulTimeOut);	DosResetEventSem(postSema, &count);	return (rc);}
开发者ID:Distrotech,项目名称:cdrkit,代码行数:11,


示例21: DosWaitEventSem

//***************************************************************************//*                                                                         *//*  BOOL waitPost()                                                        *//*                                                                         *//*  Waits for postSema being posted by device driver                       *//*  Returns:                                                               *//*    TRUE - Success                                                       *//*    FALSE - Unsuccessful access of event semaphore                       *//*                                                                         *//*  Preconditions: init() has to be called successfully before             *//*                                                                         *//***************************************************************************BOOL scsiObj::waitPost(){  ULONG count=0;  ULONG rc;                                             // return value  rc = DosWaitEventSem(postSema, -1);                   // wait forever  if (rc) return FALSE;                                 // DosWaitEventSem failed  rc = DosResetEventSem(postSema, &count);              // reset semaphore  if (rc) return FALSE;                                 // DosResetEventSem failed  return TRUE;}
开发者ID:OS2World,项目名称:APP-GRAPHICS-mtekscan,代码行数:23,


示例22: _PR_MD_WAIT

PRStatus_PR_MD_WAIT(PRThread *thread, PRIntervalTime ticks){    PRInt32 rv;    ULONG count;    PRUint32 msecs = (ticks == PR_INTERVAL_NO_TIMEOUT) ?        SEM_INDEFINITE_WAIT : PR_IntervalToMilliseconds(ticks);    rv = DosWaitEventSem(thread->md.blocked_sema, msecs);    DosResetEventSem(thread->md.blocked_sema, &count);     switch(rv)     {        case NO_ERROR:            return PR_SUCCESS;            break;        case ERROR_TIMEOUT:            _PR_THREAD_LOCK(thread);            if (thread->state == _PR_IO_WAIT) {			  ;            } else {                if (thread->wait.cvar != NULL) {                    thread->wait.cvar = NULL;                    _PR_THREAD_UNLOCK(thread);                } else {                    /* The CVAR was notified just as the timeout                     * occurred.  This led to us being notified twice.                     * call SemRequest() to clear the semaphore.                     */                    _PR_THREAD_UNLOCK(thread);                    rv = DosWaitEventSem(thread->md.blocked_sema, 0);                    DosResetEventSem(thread->md.blocked_sema, &count);                     PR_ASSERT(rv == NO_ERROR);                }            }            return PR_SUCCESS;            break;        default:            break;    }    return PR_FAILURE;}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:41,


示例23: CommandSTOP

ULONG CommandSTOP(  PLUGINWORK *pPluginWork, DECODER_PARAMS *pParams ){    ULONG ulTmp;    if(pPluginWork->fStatus == 0) {        return 101;    }    DosResetEventSem( pPluginWork->hevThreadA, &ulTmp );    pPluginWork->fStop = TRUE;    DosWaitEventSem( pPluginWork->hevThreadA, 20000 );    return 0;}
开发者ID:OS2World,项目名称:MM-SOUND-PM123-OggPlug,代码行数:12,


示例24: _sendQuery

static BOOL _sendQuery(PGROPDATA pGrop, PGROPQUERY pQuery, BOOL fPrivateEvSem){  ULONG      ulRC;  BOOL       fSuccess;  PTIB       tib;  PPIB       pib;  DosGetInfoBlocks( &tib, &pib );  if ( tib->tib_ptib2->tib2_ultid == pGrop->tid )  {    // Query send from callback function.    debug( "Query send from callback function." );    pQuery->hevReady = NULLHANDLE;    _wmGropQuery( pGrop, pQuery );    return pQuery->fSuccess;/*    return (BOOL)WinSendMsg( pGrop->hwnd, WM_GROP_QUERY, MPFROMP( pQuery ), 0 )             && pQuery->fSuccess;*/  }  if ( fPrivateEvSem )  {    ulRC = DosCreateEventSem( NULL, &pQuery->hevReady, 0, FALSE );    if ( ulRC != NO_ERROR )    {      debug( "DosCreateEventSem(), rc = %u.", ulRC );      return FALSE;    }  }  else    pQuery->hevReady = pGrop->hevReady;  fSuccess = WinPostMsg( pGrop->hwnd, WM_GROP_QUERY, MPFROMP( pQuery ), 0 );  if ( !fSuccess )  {    debug( "WinPostMsg() failed" );  }  else  {    ulRC = DosWaitEventSem( pQuery->hevReady, 3000 );    if ( ulRC != NO_ERROR )    {      debug( "DosWaitEventSem(), rc = %u.", ulRC );    }    fSuccess = pQuery->fSuccess;  }  if ( fPrivateEvSem )    DosCloseEventSem( pQuery->hevReady );  return fSuccess;}
开发者ID:OS2World,项目名称:LIB-SDL-2014,代码行数:52,


示例25: OS2_UpdateBufferThread

/* ARGSUSED */void OS2_UpdateBufferThread(void *dummy){	/* Run at timecritical priority */	DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, PRTYD_MAXIMUM - 1, 0);	while (!FinishPlayback) {		ULONG count;static	ULONG NextBuffer = 0;	/* next fragment to be filled */		/* wait for play enable */		DosWaitEventSem(Play, SEM_INDEFINITE_WAIT);		/* wait for timer event */		DosWaitEventSem(Update, SEM_INDEFINITE_WAIT);		/* reset timer semaphore */		DosResetEventSem(Update, &count);		/* fill all free buffers */		while (PlayList[NextBuffer].ulOperand3 >=			   PlayList[NextBuffer].ulOperand2) {			MUTEX_LOCK(vars);			if (Player_Paused_internal())				PlayList[NextBuffer].ulOperand2 =				  VC_SilenceBytes((SBYTE *)PlayList[NextBuffer].ulOperand1,								  BufferSize);			else				PlayList[NextBuffer].ulOperand2 =				  VC_WriteBytes((SBYTE *)PlayList[NextBuffer].ulOperand1,								BufferSize);			MUTEX_UNLOCK(vars);			/* Reset play offset, although it seems MMOS2 does it			   automagically */			PlayList[NextBuffer].ulOperand3 = 0;			NextBuffer = (NextBuffer + 1) % FRAGMENTS;		}	}	/* Tell main thread we're done */	ThreadID = 0;}
开发者ID:Bracket-,项目名称:psp-ports,代码行数:39,


示例26: CommandPLAY

ULONG CommandPLAY(  PLUGINWORK *pPluginWork, DECODER_PARAMS *pParams ){    ULONG ulTmp;    if(pPluginWork->fStatus != 0) {        return 101;    }    strncpy( pPluginWork->szFileName, pParams->filename, 4096 );    DosResetEventSem( pPluginWork->hevThreadA, &ulTmp );    DosPostEventSem( pPluginWork->hevThreadTrigger );    DosWaitEventSem( pPluginWork->hevThreadA, 20000 );        return 0;}
开发者ID:OS2World,项目名称:MM-SOUND-PM123-OggPlug,代码行数:14,



注:本文中的DosWaitEventSem函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ DosWrite函数代码示例
C++ DosSleep函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。