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

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

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

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

在下文中一共展示了DosResetEventSem函数的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: NotifyLoopThread

void NotifyLoopThread(MSG *pMsg)  {  ULONG ulPostCount;  DosResetEventSem(hevNotifyLoopSem,&ulPostCount);  pMsg = pNotifyLoopMsg;  while (1)    {    pMsg->ulMessageNumber = ulMessageNumber++;    SendMessage(pMsg);    DosWaitEventSem(hevNotifyLoopSem,5000);//    DosSleep(300);    DosResetEventSem(hevNotifyLoopSem,&ulPostCount);    }  }
开发者ID:OS2World,项目名称:APP-COMM-ComScope,代码行数:15,


示例4: vlc_sem_wait

void vlc_sem_wait (vlc_sem_t *sem){    ULONG rc;    do    {        vlc_testcancel ();        DosRequestMutexSem(sem->wait_mutex, SEM_INDEFINITE_WAIT);        rc = vlc_WaitForSingleObject (sem->hev, SEM_INDEFINITE_WAIT );        if (!rc)        {            DosRequestMutexSem(sem->count_mutex, SEM_INDEFINITE_WAIT);            sem->count--;            if (sem->count == 0)            {                ULONG ulPost;                DosResetEventSem(sem->hev, &ulPost);            }            DosReleaseMutexSem(sem->count_mutex);        }        DosReleaseMutexSem(sem->wait_mutex);    } while (rc == ERROR_INTERRUPT);}
开发者ID:CSRedRat,项目名称:vlc,代码行数:30,


示例5: 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,


示例6: GetPipeEvent

int GetPipeEvent(TEvent *Event) {  ULONG ulPostCount;  int   i;  Event->What = evNone;  for (i = 0; i < MAX_PIPES; i++) {    if (Pipes[i].used == 0) continue;    if (Pipes[i].notify == 0) continue;    if (DosResetEventSem(Pipes[i].NewData, &ulPostCount) != 0) continue;    if (ulPostCount > 0) {      // fprintf(stderr, "Pipe New Data: %d/n", i);      Event->What        = evNotify;      Event->Msg.View    = 0;      Event->Msg.Model   = Pipes[i].notify;      Event->Msg.Command = cmPipeRead;      Event->Msg.Param1  = i;      return 1;    }  }  return 0;}
开发者ID:AaronDP,项目名称:efte_adbshell,代码行数:25,


示例7: 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,


示例8: 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,


示例9: return

unsigned long Event::Reset ( ) {   if ( Handle == 0 )      return ( (unsigned long) 0xFFFFFFFF ) ;   if ( DebugFlag ) Log ( "Event(%s)::Reset.", Tag?Tag:"" ) ;   BOOL Result = FALSE ;   #ifdef __OS2__      ULONG PostCount ;      APIRET Status = DosResetEventSem ( Handle, &PostCount ) ;      if ( Status && ( Status != ERROR_ALREADY_RESET ) )         Result = FALSE ;      else         Result = TRUE ;   #else      Result = ResetEvent ( Handle ) ;   #endif   return ( Result ) ;} /* endmethod */
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:27,


示例10: 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,


示例11: Os2_reset_async_info

/* reset_async_info clear async_info in such a way that fresh add_waiter() * calls can be performed. */static void Os2_reset_async_info(void *async_info){   AsyncInfo *ai = async_info;   ULONG ul;   DosResetEventSem(ai->sem, &ul);   ai->mustwait = 0;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:11,


示例12: 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,


示例13: 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,


示例14: 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,


示例15: os2KbdQueueQuery

int os2KbdQueueQuery(){	ULONG numElements,postCount; 	(void)DosQueryQueue(hKbdQueue,&numElements);	if (numElements!=0) return 0; /* We have something in queue */	DosResetEventSem(hKbdSem,&postCount);	return 1;}
开发者ID:marioaugustorama,项目名称:tropix-xwindow,代码行数:10,


示例16: 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,


示例17: 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,


示例18: _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,


示例19: 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,


示例20: 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,


示例21: 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,


示例22: fly_init

void fly_init (int x0, int y0, int rows, int cols, char *font){    TID       tid;    int       rc;    ULONG     reset;    tiled1 = _tmalloc (tiled_size);    if (tiled1 == NULL) fly_error ("cannot allocate tiled memory/n");    us1_16 = _tmalloc (sizeof(USHORT));    us2_16 = _tmalloc (sizeof(USHORT));    pci = _tmalloc (sizeof(VIOCURSORINFO));    rc = DosCreateMutexSem (NULL, &mtx_Queue, 0, FALSE);    debug_tools ("rc = %d after DosCreateMutexSem/n", rc);    rc = DosCreateMutexSem (NULL, &mtx_Video, 0, FALSE);    debug_tools ("rc = %d after DosCreateMutexSem/n", rc);    rc = DosCreateEventSem (NULL, &hev_NewMessage, 0, FALSE);    debug_tools ("rc = %d after DosCreateEventSem/n", rc);    rc = DosCreateEventSem (NULL, &hev_VideoReady, 0, FALSE);    debug_tools ("rc = %d after DosCreateEventSem/n", rc);        grab_video ();    if (rows != -1 && cols != -1)        video_init (rows, cols);    else        video_init (25, 80);    release_video ();    DosResetEventSem (hev_VideoReady, &reset);    rc = DosCreateThread (&tid, interface_thread, 0, 0, 32786);    debug_tools ("rc = %d after DosCreateThread/n", rc);    DosWaitEventSem (hev_VideoReady, SEM_INDEFINITE_WAIT);    fl_opt.initialized = TRUE;    DosSleep (300);    if (font != NULL)        fly_set_font (font);    //debug_tools ("rows = %d, cols = %d in fly_init/n", rows, cols);    if (rows != -1 && cols != -1)        video_set_window_size (rows, cols);        debug_tools ("x0 = %d, y0 = %d in fly_init/n", x0, y0);    if (x0 >= 0 && y0 >= 0)        video_set_window_pos (x0, y0);}
开发者ID:OS2World,项目名称:LIB-libfly,代码行数:50,


示例23: DART_WaitDone

void DART_WaitDone(_THIS){  pMixBufferDesc pBufDesc;  ULONG ulPostCount;  APIRET rc;  pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[_this->hidden->iLastPlayedBuf].ulUserParm;  rc = NO_ERROR;  while ((pBufDesc->iBufferUsage != BUFFER_EMPTY) && (rc==NO_ERROR))  {    DosResetEventSem(_this->hidden->hevAudioBufferPlayed, &ulPostCount);    rc = DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000);   }}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:14,


示例24: assert

void TEventQueue::getMouseState( TEvent & ev ){#ifdef __NT__  ev.mouse.where   = lastMouse.where;  ev.mouse.buttons = lastMouse.buttons;  if ( lastMouse.buttons != 0 ) ev.what = getTicks();  // Temporarily save tick count when event was read.  INPUT_RECORD *irp = TThreads::get_next_event();  if ( irp == NULL || irp->EventType != MOUSE_EVENT ) return;  TThreads::accept_event();  curMouse.where.x = irp->Event.MouseEvent.dwMousePosition.X;  curMouse.where.y = irp->Event.MouseEvent.dwMousePosition.Y;  curMouse.buttons = irp->Event.MouseEvent.dwButtonState;  curMouse.doubleClick = (irp->Event.MouseEvent.dwEventFlags & DOUBLE_CLICK)                                ? True                                : False;  ev.mouse = curMouse;  if ( lastMouse.buttons == 0 ) ev.what = getTicks();#else   // __NT__#ifdef __OS2__    assert(! DosRequestMutexSem(TThreads::hmtxMouse1,SEM_INDEFINITE_WAIT) );#else    _disable();#endif    if( eventCount == 0 )        {        ev.what = getTicks();        ev.mouse = curMouse;        }    else        {        ev = *eventQHead;        if( ++eventQHead >= eventQueue + eventQSize )            eventQHead = eventQueue;        eventCount--;        }#ifdef __OS2__    if (eventCount==0) {      ULONG dummy;      DosResetEventSem( TThreads::hevMouse1, &dummy );    };    assert(! DosReleaseMutexSem(TThreads::hmtxMouse1) );#else    _enable();#endif  // __OS2__#endif  // __NT__    if( mouseReverse != False && ev.mouse.buttons != 0 && ev.mouse.buttons != 3 )        ev.mouse.buttons ^= 3;}
开发者ID:hackshields,项目名称:antivirus,代码行数:49,


示例25: thSwitch

APIRET APIENTRY thSwitch (void)   {   BOOL  bSuccess;   ULONG ul;   do {      DosResetEventSem (hevSammy, &ul);      DosWaitEventSem (hevSammy, SEM_INDEFINITE_WAIT);      bSuccess = ChangeWPS(pShareInitOS2->pszUserIni, pShareInitOS2->pszSystemIni);      DebugULd (1, "thSwitch", "bSuccess", bSuccess);      }   while( bSuccess );   return 0;   }
开发者ID:OS2World,项目名称:UTIL-WPS-WPSam,代码行数:15,


示例26: RTDECL

RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem){    /*     * Reset the object.     */    ULONG ulIgnore;    int rc = DosResetEventSem(SEM2HND(hEventMultiSem), &ulIgnore);    switch (rc)    {        case NO_ERROR:        case ERROR_ALREADY_RESET:            return VINF_SUCCESS;        default:            return RTErrConvertFromOS2(rc);    }}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:16,



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


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