这篇教程C++ DosCloseEventSem函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DosCloseEventSem函数的典型用法代码示例。如果您正苦于以下问题:C++ DosCloseEventSem函数的具体用法?C++ DosCloseEventSem怎么用?C++ DosCloseEventSem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DosCloseEventSem函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetClipTextint 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,
示例2: vlc_thread_cleanupstatic void vlc_thread_cleanup (struct vlc_thread *th){ vlc_threadvar_t key;retry: /* TODO: use RW lock or something similar */ vlc_mutex_lock (&super_mutex); for (key = vlc_threadvar_last; key != NULL; key = key->prev) { void *value = vlc_threadvar_get (key); if (value != NULL && key->destroy != NULL) { vlc_mutex_unlock (&super_mutex); vlc_threadvar_set (key, NULL); key->destroy (value); goto retry; } } vlc_mutex_unlock (&super_mutex); if (th->detached) { DosCloseEventSem (th->cancel_event); DosCloseEventSem (th->done_event ); free (th); }}
开发者ID:Tilka,项目名称:vlc,代码行数:27,
示例3: decoder_initint _System decoder_init( void **ppvPluginWork ){ PLUGINWORK *pPluginWork; pPluginWork = (void *)malloc( sizeof( PLUGINWORK ) ); if(pPluginWork == 0) { *ppvPluginWork = 0; return -1; } memset( pPluginWork, 0, sizeof( PLUGINWORK ) ); DosCreateEventSem( NULL, &pPluginWork->hevThreadTrigger, 0UL, FALSE ); DosCreateEventSem( NULL, &pPluginWork->hevThreadA, 0UL, FALSE ); pPluginWork->tidThreadDecode = _beginthread( ThreadDecodeMain, NULL, 1024 * 1024, pPluginWork ); if(pPluginWork->tidThreadDecode == -1) { /* can't create thread */ DosCloseEventSem( pPluginWork->hevThreadTrigger ); pPluginWork->hevThreadTrigger = NULLHANDLE; DosCloseEventSem( pPluginWork->hevThreadA ); pPluginWork->hevThreadA = NULLHANDLE; free( pPluginWork ); pPluginWork = NULL; *ppvPluginWork = 0; return -1; } *ppvPluginWork = (void *)pPluginWork; pPluginWork->songlength = 0xffffffffUL; pPluginWork->fStop = FALSE; pPluginWork->fTerminate = FALSE;// DosSetPriority( PRTYS_THREAD, PRTYC_TIMECRITICAL, PRTYD_MAXIMUM, pPluginWork->tidThreadDecode ); return 0;}
开发者ID:OS2World,项目名称:MM-SOUND-PM123-OggPlug,代码行数:30,
示例4: 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,
示例5: _cairo_os2_surface_finishstatic cairo_status_t_cairo_os2_surface_finish (void *abstract_surface){ cairo_os2_surface_t *local_os2_surface; local_os2_surface = (cairo_os2_surface_t *) abstract_surface; if ((!local_os2_surface) || (local_os2_surface->base.backend != &cairo_os2_surface_backend)) { /* Invalid parameter (wrong surface)! */ return _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH); } DosRequestMutexSem (local_os2_surface->hmtx_use_private_fields, SEM_INDEFINITE_WAIT); /* Destroy old image surface */ cairo_surface_destroy ((cairo_surface_t *) (local_os2_surface->image_surface)); /* Destroy old pixel buffer */ _buffer_free (local_os2_surface->pixels); DosCloseMutexSem (local_os2_surface->hmtx_use_private_fields); DosCloseEventSem (local_os2_surface->hev_pixel_array_came_back); /* The memory itself will be free'd by the cairo_surface_destroy () * who called us. */ return CAIRO_STATUS_SUCCESS;}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:28,
示例6: strdupint GUI::OpenPipe(char *Command, EModel *notify) { int i; for (i = 0; i < MAX_PIPES; i++) { if (Pipes[i].used == 0) { Pipes[i].reading = 1; Pipes[i].stopped = 1; Pipes[i].id = i; Pipes[i].bufused = 0; Pipes[i].bufpos = 0; Pipes[i].buflen = PIPE_BUFLEN; Pipes[i].Command = strdup(Command); Pipes[i].notify = notify; Pipes[i].DoTerm = 0; if ((Pipes[i].buffer = (char *)malloc(PIPE_BUFLEN)) == 0) { free(Pipes[i].Command); return -1; } if (0 != DosCreateMutexSem(0, &Pipes[i].Access, 0, 0)) { free(Pipes[i].Command); free(Pipes[i].buffer); return -1; } if (0 != DosCreateEventSem(0, &Pipes[i].ResumeRead, 0, 0)) { free(Pipes[i].Command); free(Pipes[i].buffer); DosCloseMutexSem(Pipes[i].Access); return -1; } if (0 != DosCreateEventSem(0, &Pipes[i].NewData, 0, 0)) { free(Pipes[i].Command); free(Pipes[i].buffer); DosCloseEventSem(Pipes[i].ResumeRead); DosCloseMutexSem(Pipes[i].Access); return -1; }#if defined(__WATCOMC__) || defined(__MT__) || defined(__MULTI__) Pipes[i].tid = _beginthread(PipeThread, FAKE_BEGINTHREAD_NULL 16384, &Pipes[i]);#else // if defined(__WATCOMC__) || defined(__MT__) || defined(__MULTI__) DosCreateThread(Pipes[i].tid, (PFNTHREAD)PipeThread, &Pipes[i], 0, /* immediate */ 16384);#endif // if defined(__WATCOMC__) || defined(__MT__) || defined(__MULTI__) Pipes[i].used = 1; // fprintf(stderr, "Pipe Open: %d/n", i); return i; } } return -1;}
开发者ID:AaronDP,项目名称:efte_adbshell,代码行数:60,
示例7: __CBeginThreadint __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,
示例8: DART_CloseAudiovoid DART_CloseAudio(_THIS){ MCI_GENERIC_PARMS GenericParms; int rc; rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_STOP, MCI_WAIT, &GenericParms, 0); if (rc!=MCIERR_SUCCESS) {#ifdef SFX_DEBUG_BUILD printf("Could not stop DART playback!/n"); fflush(stdout);#endif } DosCloseEventSem(_this->hidden->hevAudioBufferPlayed); { int i; for (i=0; i<_this->hidden->iCurrNumBufs; i++) SDL_free((void *)(_this->hidden->pMixBuffers[i].ulUserParm)); } rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0); SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL; rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_CLOSE, MCI_WAIT, &(GenericParms), 0);}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:33,
示例9: SignalUserEvent/****************************************************************/ * Routine to signal consumer to release resource. * *--------------------------------------------------------------* * * * Name: SignalUserEvent(pfAutoMode) * * * * Purpose: Posts user event semaphore to signal thread to * * release resource. Also posts event to stop * * Auto mode if *pfAutoMode is true. * * * * Usage: Called in file usercmd.c when the user selects * * Event from the semaphore menu. * * * * Method: Turns off Auto mode, if present by posting auto * * semaphore. User event is then posted. * * * * Returns: * * */****************************************************************/VOID SignalUserEvent(PULONG pfAutoMode){ ULONG rc; /* If sample is in auto mode turn auto mode off. */ if (*pfAutoMode) { rc = DosPostEventSem(hevStopAuto); if (rc) { SemError("DosPostEventSem Stop Auto",rc); } /* Wait for auto mode thread to die, so we don't end up with multiple copies of it later. */ rc = DosWaitThread(&tidAutoThread,0L); if (rc) { SemError("DosWaitThread",rc); } *pfAutoMode = FALSE; DosCloseEventSem (hevStopAuto); } /* If Auto mode haas already posted the event this is OK so we will not check error codes here. */ DosPostEventSem(aSquares[rand() % MAXRESOURCES].hev); return;}
开发者ID:MbqIIB,项目名称:DEV-SAMPLES-IBM_Dev_Toolkit_Samples,代码行数:49,
示例10: _PR_MD_DESTROY_SEMvoid_PR_MD_DESTROY_SEM(_MDSemaphore *md){ int rv; rv = DosCloseEventSem(md->sem); PR_ASSERT(rv == NO_ERROR);}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.external,代码行数:8,
示例11: avcodec_thread_free/** * free what has been allocated by avcodec_thread_init(). * must be called after decoding has finished, especially do not call while avcodec_thread_execute() is running */void avcodec_thread_free(AVCodecContext *s){ ThreadContext *c= s->thread_opaque; int i; for(i=0; i<s->thread_count; i++){ c[i].func= NULL; DosPostEventSem(c[i].work_sem); // ReleaseSemaphore(c[i].work_sem, 1, 0); DosWaitThread((PTID)&c[i].thread,DCWW_WAIT);// WaitForSingleObject(c[i].thread, INFINITE); if(c[i].work_sem) DosCloseEventSem(c[i].work_sem);//CloseHandle(c[i].work_sem); if(c[i].done_sem) DosCloseEventSem(c[i].done_sem);//CloseHandle(c[i].done_sem); } av_freep(&s->thread_opaque);}
开发者ID:Acidburn0zzz,项目名称:ffmpeg-concat,代码行数:21,
示例12: DosCloseEventSem//***************************************************************************//* *//* BOOL closeSemaphore() *//* *//* Closes the Event Semaphore *//* Returns: *//* TRUE - Success *//* FALSE - Unsuccessful closing of event semaphore *//* *//* Preconditions: init_Semaphore has to be called successfully before *//* *//***************************************************************************BOOL scsiObj::closeSemaphore(){ ULONG rc; // return value rc = DosCloseEventSem(postSema); // close event semaphore if (rc) return FALSE; // DosCloseEventSem failed return TRUE;}
开发者ID:OS2World,项目名称:APP-GRAPHICS-mtekscan,代码行数:20,
示例13: Os2_delete_async_info/* delete_async_info deletes the structure created by create_async_info and * all of its components. */static void Os2_delete_async_info(void *async_info){ AsyncInfo *ai = async_info; if (ai == NULL) return; DosCloseEventSem(ai->sem); Free_TSD(ai->TSD, ai);}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:12,
示例14: DosCloseEventSemomni_semaphore::~omni_semaphore(void){ APIRET rc = DosCloseEventSem( nt_sem ); if (rc!=0) { DB( cerr << "omni_semaphore::~omni_semaphore: DosCloseEventSem error " << rc << endl ); throw omni_thread_fatal(rc); }}
开发者ID:OS2World,项目名称:APP-INTERNET-PMVNC-Server,代码行数:9,
示例15: vlc_joinvoid vlc_join (vlc_thread_t th, void **result){ ULONG rc; do { vlc_testcancel(); rc = vlc_WaitForSingleObject( th->done_event, SEM_INDEFINITE_WAIT ); } while( rc == ERROR_INTERRUPT ); if (result != NULL) *result = th->data; DosCloseEventSem( th->cancel_event ); DosCloseEventSem( th->done_event ); free( th );}
开发者ID:Tilka,项目名称:vlc,代码行数:18,
示例16: SDL_DestroySemaphore/* Free the semaphore */DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem){ if ( sem ) { if ( sem->id ) { DosCloseEventSem(sem->changed); DosCloseMutexSem(sem->id); sem->id = 0; } SDL_free(sem); }}
开发者ID:3bu1,项目名称:crossbridge,代码行数:12,
示例17: StopSemaphore/****************************************************************/ * Routine to really stop semaphore example. * *--------------------------------------------------------------* * * * Name: StopSemaphore( PVOID pvArg ) * * * * Purpose: Waits for threads to complete, * * Sends message to message thread to indicate this * * has occurred, and exits. * * * * Usage: Exec'd from BeginStop when user selects Stop from * * Semaphore menu. * * * * Method: Turns off Auto mode, if present by posting auto * * semaphore. Then stop event is posted. Waits * * for threads to die. * * Returns: * * */****************************************************************/VOID StopSemaphore( PVOID pvArg ){ ULONG rc,usCount, i; PULONG pfAutoMode = (PULONG)pvArg; if (*pfAutoMode) { rc = DosWaitThread(&tidAutoThread,0L); if (rc && (rc != ERROR_INVALID_THREADID)) { SemError("DosWaitThread",rc); } *pfAutoMode = FALSE; } /* Wait for usConsumer threads to die. Order of death not important. */ for (usCount = 0; usCount < usConsumerThreadsCreated; usCount++) { rc = DosWaitThread(&thrConsumers[usCount].tid,0L); /* rc is ERROR_INVALID_THREADID the thread is already dead.*/ /* This is OK and not a error. */ if (rc && (rc != ERROR_INVALID_THREADID)) { SemError("DosWaitThread",rc); } } /* Threads dead so we don't need semaphores any more. */ DosCloseEventSem(hevStopAuto); DosCloseEventSem(hevStop); DosCloseMutexSem(hmtxOwnResource); for (i = 0; i < MAXRESOURCES; i++) { DosCloseEventSem(aSquares[i].hev); } DosCloseMuxWaitSem (hmuxResource); WinPostMsg (hwndMain, WM_COMMAND, (MPARAM)IDM_STOPFINISHED, (MPARAM)NULL); DosExit (EXIT_THREAD, 0); return;}
开发者ID:MbqIIB,项目名称:DEV-SAMPLES-IBM_Dev_Toolkit_Samples,代码行数:60,
示例18: DART_CloseDevicestatic voidDART_CloseDevice(_THIS){ MCI_GENERIC_PARMS GenericParms; int rc; int i; if (_this->hidden != NULL) { // Stop DART playback if (_this->hidden->iCurrDeviceOrd) { rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_STOP, MCI_WAIT, &GenericParms, 0);#ifdef SFX_DEBUG_BUILD if (rc != MCIERR_SUCCESS) { printf("Could not stop DART playback!/n"); fflush(stdout); }#endif } // Close event semaphore if (_this->hidden->hevAudioBufferPlayed) { DosCloseEventSem(_this->hidden->hevAudioBufferPlayed); _this->hidden->hevAudioBufferPlayed = 0; } // Free memory of buffer descriptions for (i = 0; i < _this->hidden->iCurrNumBufs; i++) { SDL_free((void *) (_this->hidden->pMixBuffers[i].ulUserParm)); _this->hidden->pMixBuffers[i].ulUserParm = 0; } _this->hidden->iCurrNumBufs = 0; // Deallocate buffers if (_this->hidden->iCurrDeviceOrd) { rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0); } // Free bufferlist if (_this->hidden->pMixBuffers != NULL) { SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL; } // Close dart if (_this->hidden->iCurrDeviceOrd) { rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_CLOSE, MCI_WAIT, &(GenericParms), 0); } _this->hidden->iCurrDeviceOrd = 0; SDL_free(_this->hidden); _this->hidden = NULL; }}
开发者ID:Bananattack,项目名称:verge3,代码行数:53,
示例19: vlc_timer_destroyvoid vlc_timer_destroy (vlc_timer_t timer){ if (timer->htimer != NULLHANDLE) DosStopTimer (timer->htimer); timer->quit = true; DosPostEventSem (timer->hev); DosWaitThread (&timer->tid, DCWW_WAIT); DosCloseEventSem (timer->hev); free (timer);}
开发者ID:Tilka,项目名称:vlc,代码行数:12,
示例20: vlc_clone_attrstatic int vlc_clone_attr (vlc_thread_t *p_handle, bool detached, void *(*entry) (void *), void *data, int priority){ struct vlc_thread *th = malloc (sizeof (*th)); if (unlikely(th == NULL)) return ENOMEM; th->entry = entry; th->data = data; th->detached = detached; th->killable = false; /* not until vlc_entry() ! */ th->killed = false; th->cleaners = NULL; if( DosCreateEventSem (NULL, &th->cancel_event, 0, FALSE)) goto error; if( DosCreateEventSem (NULL, &th->done_event, 0, FALSE)) goto error; th->tid = _beginthread (vlc_entry, NULL, 1024 * 1024, th); if((int)th->tid == -1) goto error; if (p_handle != NULL) *p_handle = th; if (priority) DosSetPriority(PRTYS_THREAD, HIBYTE(priority), LOBYTE(priority), th->tid); return 0;error: DosCloseEventSem (th->cancel_event); DosCloseEventSem (th->done_event); free (th); return ENOMEM;}
开发者ID:Tilka,项目名称:vlc,代码行数:40,
示例21: _sendQuerystatic 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,
示例22: pthread_cond_destroyint pthread_cond_destroy(pthread_cond_t *cond){ APIRET rc; do { rc = DosCloseEventSem(cond->semaphore); if (rc == 301) DosPostEventSem(cond->semaphore); } while (rc == 301); if (rc) return EINVAL; return 0;}
开发者ID:OPSF,项目名称:uClinux,代码行数:13,
示例23: DosPostEventSemint GUI::ClosePipe(int id) { if ((id < 0) || (id > MAX_PIPES)) return -1; if (Pipes[id].used == 0) return -1; if (Pipes[id].reading == 1) { Pipes[id].DoTerm = 1; DosPostEventSem(Pipes[id].ResumeRead); DosWaitThread(&Pipes[id].tid, DCWW_WAIT); } free(Pipes[id].buffer); free(Pipes[id].Command); DosCloseEventSem(Pipes[id].NewData); DosCloseEventSem(Pipes[id].ResumeRead); DosCloseMutexSem(Pipes[id].Access); // fprintf(stderr, "Pipe Close: %d/n", id); Pipes[id].used = 0; // ConContinue(); return Pipes[id].RetCode;}
开发者ID:AaronDP,项目名称:efte_adbshell,代码行数:22,
示例24: DosCloseEventSemEvent::~Event ( ) { if ( Handle ) { #ifdef __OS2__ DosCloseEventSem ( Handle ) ; #else CloseHandle ( Handle ) ; #endif } /* endif */ if ( Tag ) free ( Tag ) ;} /* endmethod */
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:13,
示例25: PutClipTextint PutClipText(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); if (0 == DosAllocSharedMem((void **)&mem, MEM_PREFIX "CLIPDATA", cd->fLen + 5, PAG_COMMIT | PAG_READ | PAG_WRITE)) { ULONG L = cd->fLen; memcpy((void *)mem, (void *)&L, 4); strcpy(mem + 4, cd->fChar); } DosPostEventSem(hevPut); DosWaitEventSem(hevEnd, SEM_INDEFINITE_WAIT); DosPostEventSem(hevPut); DosReleaseMutexSem(hmtxSyn); DosCloseEventSem(hevPut);/* DosCloseEventSem(hevGet); */ DosCloseEventSem(hevEnd); DosCloseMutexSem(hmtxSyn); if (mem) DosFreeMem(mem); return 0; }
开发者ID:OS2World,项目名称:APP-EDITOR-fte,代码行数:38,
示例26: DosCloseEventSemvoid scsi_close_device ( ) { if (postSema) DosCloseEventSem(postSema); // Close event semaphore. postSema = 0; if (driver_handle) // Close driver. DosClose(driver_handle); driver_handle = 0; if (buffer) // Free buffer. DosFreeMem(buffer); buffer = 0; }
开发者ID:OS2World,项目名称:APP-GRAPHICS-mtekscan,代码行数:14,
示例27: thread_cond_cleanupstatic apr_status_t thread_cond_cleanup(void *data){ apr_thread_cond_t *cv = data; if (cv->semaphore) { DosCloseEventSem(cv->semaphore); } if (cv->mutex) { DosCloseMutexSem(cv->mutex); } return APR_SUCCESS;}
开发者ID:cmjonze,项目名称:apr,代码行数:14,
示例28: decoder_uninitBOOL _System decoder_uninit( void *pvPluginWork ){ PLUGINWORK *pPluginWork = (PLUGINWORK *)pvPluginWork; ULONG ulTmp; if (pvPluginWork) { pPluginWork->fTerminate = TRUE; if (pPluginWork->hevThreadTrigger) { DosResetEventSem( pPluginWork->hevThreadA, &ulTmp ); pPluginWork->fTerminate = TRUE; DosPostEventSem( pPluginWork->hevThreadTrigger ); DosWaitEventSem( pPluginWork->hevThreadA, 20000 ); DosCloseEventSem( pPluginWork->hevThreadTrigger ); } if (pPluginWork->hevThreadA) { DosCloseEventSem( pPluginWork->hevThreadA ); } free( pvPluginWork ); } return 0;}
开发者ID:OS2World,项目名称:MM-SOUND-PM123-OggPlug,代码行数:23,
注:本文中的DosCloseEventSem函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DosDevIOCtl函数代码示例 C++ DosAllocMem函数代码示例 |