这篇教程C++ DosSleep函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DosSleep函数的典型用法代码示例。如果您正苦于以下问题:C++ DosSleep函数的具体用法?C++ DosSleep怎么用?C++ DosSleep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DosSleep函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: aboutProcRMRESULT EXPENTRY aboutProcR( HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2 ){INT i;switch ( msg ) { case WM_INITDLG: return WinDefDlgProc( hwndDlg, msg, mp1, mp2 ); case WM_COMMAND: switch( SHORT1FROMMP( mp1 ) ) { case DID_CANCEL : WinShowWindow(WinWindowFromID(hwndDlg, DID_CANCEL), FALSE); for( i=0;i<4;i++ ) { WinShowWindow(WinWindowFromID(hwndDlg, ID_BEGSCREEN), FALSE); DosSleep(200); WinShowWindow(WinWindowFromID(hwndDlg, ID_BEGSCREEN), TRUE); DosSleep(200); } WinDismissDlg( hwndDlg, TRUE ); break; default : return WinDefDlgProc( hwndDlg, msg, mp1, mp2 ); } break; default : return WinDefDlgProc( hwndDlg, msg, mp1, mp2 ); }return (MRESULT) FALSE;}
开发者ID:OS2World,项目名称:APP-DATABASE-Datapad,代码行数:33,
示例2: alarm_threadstatic VOID FAR alarm_thread ( VOID ){ while(1) { if (bAlarmRunning) { DosSleep(1000L); uTime--; if (uTime==0L) { // send signal to the main process.. I could have put raise() here // however that would require the use of the multithreaded library, // and it does not contain raise()! // I tried it with the standard library, this signaled ok, but a // test printf in the signal would not work and even caused SEGV. // So I signal the process through OS/2 and then the process // signals itself. if (bAlarmRunning) DosFlagProcess(pidMain,FLGP_PID, PFLG_A,1); bAlarmRunning=FALSE; } } else DosSleep(500L); }}
开发者ID:Kiddinglife,项目名称:4.4BSD-Lite,代码行数:26,
示例3: mainvoid main(int argc, char **argv){ APIRET rc; ULONG ulAction = 0; TID tid = 0; char szTemp[] = "NPU4011$"; char szDevName[128] = "//DEV//"; if (argc > 1) { strcpy(szTemp, argv[1]); szTemp[0]++; } strcat(szDevName, szTemp); printf("MPUTRACE - Theta Band Software MPU-401 Driver Trace Utility/n"); printf("%d Trace Messages supported/n", NUM_TRACES); printf("Opening %s/n", szDevName); rc = DosOpen((PSZ) szDevName, &hfile, &ulAction, 0, 0, OPEN_FLAG, OPEN_MODE, NULL); if (rc) { printf("Error %d while trying to open MPU-401 device driver/n", rc); return; } ULONG ulSize1; ULONG ulSize2 = sizeof(STATUS); rc = DosDevIOCtl(hfile, 0x80, 0, NULL, ulSize1, &ulSize1, &status, ulSize2, &ulSize2); if (rc) { printf("Error %d while trying to get MPU-401 status/n", rc); return; } PrintStatus(); printf("Creating thread/n"); rc = DosCreateThread(&tid, (PFNTHREAD) Thread, 0, CREATE_READY | STACK_COMMITTED, 8192); if (rc) { printf("DosCreateThread failed with RC = %lu/n", rc); return; } while (!fRunning) DosSleep(100); printf("Hit any key to quit. Program will then exit after the next message./n"); getch(); printf("Quitting .../n"); fQuit = TRUE; while (fRunning) DosSleep(100); DosSleep(500); // wait until the thread really ends DosClose(hfile);}
开发者ID:OS2World,项目名称:DRV-MPU-401,代码行数:55,
示例4: poplog// poplog( )//// Open the popuplog and sent to printsys( )//void poplog(struct PROGRAMOPTS *prgoptions){ int start = 1; char buffer[256]; FILE *popfile; if(access(prgoptions->popupfile, F_OK) == 0) { popfile = fopen(prgoptions->popupfile, "rt"); while(!feof(popfile)) { fgets(buffer, 256, popfile); if(start == 1) { printsys(" --< START POPUPLOG ENTRY >-- "); start = 0; } if((int)buffer[0] == 45) { printsys(" --< END POPUPLOG ENTRY >-- "); start = 1; } else if((int)buffer[0] != 0) printsys( buffer ); DosSleep(20L); } printsys(" --< END POPUPLOG ENTRY >-- "); fclose(popfile); remove(prgoptions->popupfile); } if(access(prgoptions->flashlog, F_OK) == 0) { popfile = fopen(prgoptions->flashlog, "rt"); while(!feof(popfile)) { fgets(buffer, 256, popfile); printsys( buffer ); DosSleep(20L); } fclose(popfile); remove(prgoptions->flashlog); }}
开发者ID:OS2World,项目名称:UTIL-SYSTEM-SysLogd,代码行数:58,
示例5: StdLib_RetardVOID StdLib_Retard( VOID ){ // Ждем некоторое время. #ifdef I386_ARCHITECTURE DosSleep( 50 ); #else DosSleep( 10 ); #endif // Возврат. return;}
开发者ID:OS2World,项目名称:UTIL-WPS-Nice_OS2_Enhancer,代码行数:12,
示例6: priority/* priority_thread This thread controls the priority of the drawing thread. With these changes, if a saver module runs on low priority (this is the default setting), it rises to normal priority twice a second for 0.1 seconds. This should solve the problem that, when very time-consuming processes were running, the module seemed not to become active at all (in fact it became active, but did not get enough CPU time to do its saver action). There should be no reason to alter the code.*/void priority_thread(void *args){ DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); for(;!stop_priority_thread;){ int i; DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, 0, tidDraw); DosSleep(100); DosSetPriority(PRTYS_THREAD, PRTYC_IDLETIME, 0, tidDraw); for(i=0;!stop_priority_thread && i<4;i++) DosSleep(100); }}
开发者ID:NicoleRauch,项目名称:ScreenSaverModules,代码行数:23,
示例7: PostListensstatic void PostListens( void ){ int i; DosSleep( 0 ); for( i = NUM_REC_BUFFS-1; i >= 0; --i ) { if( !InUse( RecECB[i] ) ) { PostAListen( i ); } } /* make sure other side get the listens up */ DosSleep( 100 );}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:13,
示例8: DosSleepvoid omni_thread::sleep(unsigned long secs, unsigned long nanosecs){ if (secs <= MAX_SLEEP_SECONDS) { DosSleep(secs * 1000 + nanosecs / 1000000); return; } ULONG no_of_max_sleeps = secs / MAX_SLEEP_SECONDS; for (ULONG i = 0; i < no_of_max_sleeps; i++) DosSleep(MAX_SLEEP_SECONDS * 1000); DosSleep((secs % MAX_SLEEP_SECONDS) * 1000 + nanosecs / 1000000);}
开发者ID:OS2World,项目名称:APP-INTERNET-PMVNC-Server,代码行数:14,
示例9: system_End/** * Cleans up after system_Init() and system_Configure(). */void system_End(void){ if( tidIPCFirst == _gettid()) { HPIPE hpipe; ULONG ulAction; ULONG cbActual; ULONG rc; do { rc = DosOpen( VLC_IPC_PIPE, &hpipe, &ulAction, 0, 0, OPEN_ACTION_OPEN_IF_EXISTS, OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYREADWRITE | OPEN_FLAGS_FAIL_ON_ERROR, NULL ); if( rc == ERROR_PIPE_BUSY ) DosWaitNPipe( VLC_IPC_PIPE, -1 ); else if( rc ) DosSleep( 1 ); } while( rc ); /* Ask for IPCHelper to quit */ ULONG ulCmd = IPC_CMD_QUIT; DosWrite( hpipe, &ulCmd, sizeof( ulCmd ), &cbActual ); DosClose( hpipe ); TID tid = tidIPCHelper; DosWaitThread( &tid, DCWW_WAIT ); }}
开发者ID:etix,项目名称:vlc,代码行数:36,
示例10: RTDECLRTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies){ LogFlow(("RTThreadSleep: cMillies=%d/n", cMillies)); DosSleep(cMillies); LogFlow(("RTThreadSleep: returning (cMillies=%d)/n", cMillies)); return VINF_SUCCESS;}
开发者ID:stefano-garzarella,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:7,
示例11: RemoteDiscovoid RemoteDisco( void ){ int i; DosSleep( 500 ); /* make sure last packet gets sent */ Listening = 0; _INITSPXECB( Conn, 1, 0, 0 ); if( SpxTerminateConnection( Connection, &ConnECB ) == 0 ) { while( InUse( ConnECB ) ) IPXRelinquishControl(); } for( i = NUM_REC_BUFFS-1; i >= 0; --i ) { if( InUse( RecECB[i] ) ) { SpxCancelPacket( &RecECB[i] ); } } if( InUse( SendECB ) ) { SpxCancelPacket( &SendECB ); } for( i = NUM_REC_BUFFS-1; i >= 0; --i ) { ZeroArray( RecHead[i] ); ZeroArray( RecECB[i] ); } ZeroArray( ConnHead ); ZeroArray( SendHead ); ZeroArray( ConnECB ); ZeroArray( SendECB );}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:27,
示例12: Eingangvoid Eingang(){ DosBeep(3000,300); DosSleep(1000); DosBeep(4000,200); DosExit(0,0);}
开发者ID:GYGit,项目名称:reactos,代码行数:7,
示例13: WaitForSlipstatic void WaitForSlip(void) { int FirstTime = 1; APIRET rc; short Seconds = Timeout; do { rc = DosOpenEventSem("//sem32//slip//monitor", &slip_running); if (rc) { if (FirstTime) { printf("[ Waiting for SLIP - maximum wait = %d seconds ]/n", Timeout); FirstTime = 0; } Seconds--; if (Seconds >= 0) { if (Debug) { fprintf(stderr, "."); fflush(stderr); } DosSleep(1000L); } } } while (rc && (Seconds >= 0)); if (Debug) { fprintf(stderr, "/n"); } if (Seconds < 0) { printf("The SLIP driver appears not to have started./n"); exit(1); }} // WaitForSlip()
开发者ID:OS2World,项目名称:APP-INTERNET-SlipFree,代码行数:31,
示例14: RunThreadsOn/*===============RunThreadsOn===============*/void RunThreadsOn (threadfunc_t func){ LONG i; if (numthreads <= 1) { work_threads[0] = -1; func (NULL); return; } workfunc = func; for (i = 0; i < numthreads; i++) { work_threads[i] = _beginthread(ThreadWorkerFunc, NULL, stacksiz, (void *)i); if (work_threads[i] == -1) COM_Error ("_beginthread() failed"); } for (i = 0; i < numthreads; i++) { while (work_threads[i] != -1) DosSleep (100); }}
开发者ID:svn2github,项目名称:uhexen2,代码行数:31,
示例15: hb_taskFreezestatic void hb_taskFreeze( HB_MAXINT wakeup ){#if defined( HB_OS_DOS ) while( wakeup > hb_taskTimeStop( 0 ) ) { union REGS regs; regs.h.ah = 2; regs.HB_XREGS.ax = 0x1680; HB_DOS_INT86( 0x2F, ®s, ®s ); }#else wakeup -= hb_taskTimeStop( 0 ); if( wakeup > 0 ) {# if defined( __DJGPP__ ) usleep( wakeup * 1000 );# elif defined( HB_OS_WIN ) Sleep( wakeup );# elif defined( HB_OS_OS2 ) DosSleep( wakeup ); /* Duration is in milliseconds */# elif defined( HB_OS_UNIX ) struct timeval tv; tv.tv_sec = wakeup / 1000; tv.tv_usec = ( wakeup % 1000 ) * 1000; select( 0, NULL, NULL, NULL, &tv );# endif }#endif}
开发者ID:JamesLinus,项目名称:core,代码行数:31,
示例16: _WM_Lock/* _WM_Lock(wmlock) wmlock = a pointer to a value returns nothing Attempts to set a lock on the MDI tree so that only 1 library command may access it at any time. If lock fails the process retries until successful. */void _WM_Lock(int * wmlock) { LOCK_START: /* Check if lock is clear, if so set it */ if (__builtin_expect(((*wmlock) == 0), 1)) { (*wmlock)++; /* Now that the lock is set, make sure we * don't have a race condition. If so, * decrement the lock by one and retry. */ if (__builtin_expect(((*wmlock) == 1), 1)) { return; /* Lock cleanly set */ } (*wmlock)--; }#ifdef _WIN32 Sleep(10);#elif defined(__OS2__) || defined(__EMX__) DosSleep(10);#elif defined(WILDMIDI_AMIGA) Delay(1);#elif defined(__vita__) sceKernelDelayThread(500);#elif defined(__SWITCH__) svcSleepThread(500 * 1000);#else usleep(500);#endif goto LOCK_START;}
开发者ID:Mindwerks,项目名称:wildmidi,代码行数:39,
示例17: _F_SendCmdToServerextern "C" APIRET APIENTRY _F_SendCmdToServer(void *recvobj, int ncmd, int data){ int rc; LOCK(AccessF_pipe_cli); rc = ((class NPipe *)(recvobj))->SendCmdToServer(ncmd, data); if(rc == ERROR_BROKEN_PIPE) /* attempt to reconnect till timeout */ { int raz; debug(1, 1)(__FUNCTION__ " Broken Pipe, Try to reconnect.../n"); for(raz = 0;raz < 10; raz++) { delete ((class NPipe *)(recvobj)); recvobj = NULL; DosSleep(100+raz*10); recvobj = new NPipe(PipeName,CLIENT_MODE); rc = ((class NPipe *)(recvobj))->Open(); if(rc) { debug(1, 1)(__FUNCTION__ " Broken Pipe, Server still down.../n"); } else { rc = ((class NPipe *)(recvobj))->HandShake(); if(rc == HAND_SHAKE_ERROR) { debug(1, 0)("Error handshake %i, pipe %s/n",rc,PipeName); } else { break; } } } } UNLOCK(AccessF_pipe_cli); return rc;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:30,
示例18: video_canvas_createvideo_canvas_t video_canvas_create(const char *title, UINT *width, UINT *height, int mapped, canvas_redraw_t exposure_handler, const palette_t *palette, struct video_frame_buffer_s *fb){ video_canvas_t canvas_new; DEBUG(("Creating canvas width=%d height=%d", *width, *height)); if (palette->num_entries > 255) { log_error(video_log, "Too many colors requested."); return (video_canvas_t) NULL; } vidlog("canvas alloc",1); canvas_new = lib_calloc(1,sizeof(struct _canvas)); if (!canvas_new) return (video_canvas_t) NULL; canvas_new->init_ready = FALSE; // canvas_new not yet initialized canvas_new->width = *width; canvas_new->height = *height; canvas_new->pbmi_initialized = FALSE; // pbmi not yet initialized rc=DosCreateMutexSem("//SEM32//GFX", &hmtx, 0, FALSE); // gfx init begin vidlog("Create: ",rc); _beginthread(PM_mainloop,NULL,0x4000,&canvas_new); while (!canvas_new->pbmi_initialized) DosSleep(1); video_canvas_set_palette(canvas_new, palette); canvas_new->exposure_handler = exposure_handler; return canvas_new;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:34,
示例19: bug/*@ XBitmap::Load(const char* filename, XBitmapFilter * params, BOOL releaseParams)@group loading a bitmap@remarks Load a bitmap from a file. <P><I>If this method is used, GBM.DLL and OLLGLIB.DLL must be in the LIBPATH.</I> <P>Due a bug (?) in OS/2-GPI you should specify params->cBitCount = BFP_BPP_TRUECOLOR if you want to modify or resave the bitmap.@parameters <t ' C++ DosWaitEventSem函数代码示例 C++ DosResetEventSem函数代码示例
|