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

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

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

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

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

示例1: dump_buffer

static void dump_buffer (int i){    static int index = 0;    void *b;    b = buffer;    if (index + i > bsize) {        do {            DosRequestMutexSem (mutex, SEM_INDEFINITE_WAIT);            if (ready != 0) {                DosReleaseMutexSem(mutex);                break;            }            DosReleaseMutexSem (mutex);            DosSleep (20);        } while (TRUE);        MixBuffers[next].ulBufferLength = index;        MixSetupParms.pmixWrite (MixSetupParms.ulMixHandle,                                 &(MixBuffers[next]),1);        ready--;        next++;        index = 0;        if (next == BUFFERCOUNT) {            next=0;        }    }    memcpy (&((char*)MixBuffers[next].pBuffer)[index], b, i);    index += i;}
开发者ID:SimonKagstrom,项目名称:sarien-j2me,代码行数:35,


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


示例3: thread_cond_timedwait

static apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond,                                          apr_thread_mutex_t *mutex,                                          ULONG timeout_ms ){    ULONG rc;    apr_status_t rv = APR_SUCCESS;    int wake = FALSE;    unsigned long generation;    DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT);    cond->num_waiting++;    generation = cond->generation;    DosReleaseMutexSem(cond->mutex);    apr_thread_mutex_unlock(mutex);    do {        rc = DosWaitEventSem(cond->semaphore, timeout_ms);        DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT);        if (cond->num_wake) {            if (cond->generation != generation) {                cond->num_wake--;                cond->num_waiting--;                rv = APR_SUCCESS;                break;            } else {                wake = TRUE;            }        }        else if (rc != 0) {            cond->num_waiting--;            rv = APR_TIMEUP;            break;        }        DosReleaseMutexSem(cond->mutex);        if (wake) {            wake = FALSE;            DosPostEventSem(cond->semaphore);        }    } while (1);    DosReleaseMutexSem(cond->mutex);    apr_thread_mutex_lock(mutex);    return rv;}
开发者ID:cmjonze,项目名称:apr,代码行数:49,


示例4: CreatePluginList

WaWEPluginList_p CreatePluginList(int iPluginType){  WaWEPluginList_p pResult = NULL;  WaWEPluginList_p pLast = NULL;  WaWEPluginList_p pNew;  WaWEPlugin_p temp;  if (DosRequestMutexSem(PluginListProtector_Sem, SEM_INDEFINITE_WAIT)==NO_ERROR)  {    temp = PluginListHead;    while (temp)    {      if (temp->iPluginType == iPluginType)      {        pNew = (WaWEPluginList_p) dbg_malloc(sizeof(WaWEPluginList_t));        if (pNew)        {          pNew->pNext = NULL;          pNew->pPlugin = temp;          if (!pResult)          {            pResult = pNew;          } else          {            pLast->pNext = pNew;          }          pLast = pNew;        }      }      temp = temp->pNext;    }    DosReleaseMutexSem(PluginListProtector_Sem);  }  return pResult;}
开发者ID:OS2World,项目名称:MM-SOUND-WaWE,代码行数:35,


示例5: GetExportPluginForFormat

WaWEPlugin_p GetExportPluginForFormat(WaWEExP_Create_Desc_p pFormatDesc){  WaWEPlugin_p pResult = NULL;  WaWEPlugin_p temp = NULL;  int iImportance;  if (DosRequestMutexSem(PluginListProtector_Sem, SEM_INDEFINITE_WAIT)==NO_ERROR)  {    // Go through all plugins, in order of importance,    // and check them if they can open the file.    // Return the first one, which reports success!    for (iImportance = WAWE_PLUGIN_IMPORTANCE_MAX;         iImportance >= WAWE_PLUGIN_IMPORTANCE_MIN;         iImportance--)    {      temp = PluginListHead;      while ((temp) && (!pResult))      {        if ((temp->iPluginType == WAWE_PLUGIN_TYPE_EXPORT) &&            (temp->iPluginImportance == iImportance))        {          if (temp->TypeSpecificInfo.ExportPluginInfo.fnIsFormatSupported(pFormatDesc))          {            // Hey, found a plugin which can write in this format!            pResult = temp;          }        }        temp = temp->pNext;      }      if (pResult) break;    }    DosReleaseMutexSem(PluginListProtector_Sem);  }  return pResult;}
开发者ID:OS2World,项目名称:MM-SOUND-WaWE,代码行数:35,


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


示例7: internal_SetPageFont

static void internal_SetPageFont(HWND hwnd){  char *pchTemp;  // Set new window fonts!  if (DosRequestMutexSem(hmtxUseNLSTextArray, SEM_INDEFINITE_WAIT)==NO_ERROR)  {    pchTemp = apchNLSText[SSMODULE_NLSTEXT_FONTTOUSE];    if (pchTemp)    {      HWND hwndChild;      HENUM henum;      // Oookay, we have the font, set the page and all controls inside it!      WinSetPresParam(hwnd, PP_FONTNAMESIZE,		      strlen(pchTemp)+1,		      pchTemp);      // Now go through all of its children, and set it there, too!      henum = WinBeginEnumWindows(hwnd);      while ((hwndChild = WinGetNextWindow(henum))!=NULLHANDLE)      {	WinSetPresParam(hwndChild, PP_FONTNAMESIZE,			strlen(pchTemp)+1,			pchTemp);      }      WinEndEnumWindows(henum);    }    DosReleaseMutexSem(hmtxUseNLSTextArray);  }}
开发者ID:OS2World,项目名称:UTIL-WPS-Doodle-Screen-Saver,代码行数:34,


示例8: cairo_os2_surface_set_hwnd

/** * cairo_os2_surface_set_hwnd: * @surface: the cairo surface to associate with the window handle * @hwnd_client_window: the window handle of the client window * * Sets window handle for surface. If Cairo wants to blit into the window * because it is set to blit as the surface changes (see * cairo_os2_surface_set_manual_window_refresh()), then there are two ways it * can choose: * If it knows the HWND of the surface, then it invalidates that area, so the * application will get a WM_PAINT message and it can call * cairo_os2_surface_refresh_window() to redraw that area. Otherwise cairo itself * will use the HPS it got at surface creation time, and blit the pixels itself. * It's also a solution, but experience shows that if this happens from a non-PM * thread, then it can screw up PM internals. * * So, best solution is to set the HWND for the surface after the surface * creation, so every blit will be done from application's message processing * loop, which is the safest way to do. * * Since: 1.4 **/voidcairo_os2_surface_set_hwnd (cairo_surface_t *surface,                            HWND             hwnd_client_window){    cairo_os2_surface_t *local_os2_surface;    local_os2_surface = (cairo_os2_surface_t *) surface;    if ((!local_os2_surface) ||        (local_os2_surface->base.backend != &cairo_os2_surface_backend))    {        /* Invalid parameter (wrong surface)! */        return;    }    if (DosRequestMutexSem (local_os2_surface->hmtx_use_private_fields, SEM_INDEFINITE_WAIT)        != NO_ERROR)    {        /* Could not get mutex! */        return;    }    local_os2_surface->hwnd_client_window = hwnd_client_window;    DosReleaseMutexSem (local_os2_surface->hmtx_use_private_fields);}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:47,


示例9: internal_SetPwdProtWindowText

static void internal_SetPwdProtWindowText(HWND hwnd){  char *pchTemp;  // Set new window texts!  if (DosRequestMutexSem(hmtxUseNLSTextArray, SEM_INDEFINITE_WAIT)==NO_ERROR)  {    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_TITLE];    if (pchTemp)      WinSetWindowText(hwnd, pchTemp);    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_TEXT];    if (pchTemp)      WinSetDlgItemText(hwnd, ST_PLEASEENTERTHEPASSWORD, pchTemp);    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_OKBUTTON];    if (pchTemp)      WinSetDlgItemText(hwnd, PB_OK, pchTemp);    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_CANCELBUTTON];    if (pchTemp)      WinSetDlgItemText(hwnd, PB_CANCEL, pchTemp);    DosReleaseMutexSem(hmtxUseNLSTextArray);  }}
开发者ID:OS2World,项目名称:UTIL-WPS-Doodle-Screen-Saver,代码行数:26,


示例10: _cairo_os2_surface_release_source_image

static void_cairo_os2_surface_release_source_image (void                  *abstract_surface,                                         cairo_image_surface_t *image,                                         void                  *image_extra){    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;    }    /* Decrease Lend counter! */    DosRequestMutexSem (local_os2_surface->hmtx_use_private_fields, SEM_INDEFINITE_WAIT);    if (local_os2_surface->pixel_array_lend_count > 0)        local_os2_surface->pixel_array_lend_count--;    DosPostEventSem (local_os2_surface->hev_pixel_array_came_back);    DosReleaseMutexSem (local_os2_surface->hmtx_use_private_fields);    return;}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:25,


示例11: RequestCom

static int RequestCom(void){   USHORT res;   HMTX sem=0;   printf("Sending message to AM4PM to release COM port/n");   res=SendExtQMsg(EQ_RELCOM, NULL, 0);   if (res)      return res;   res=DosOpenMutexSem(szSemCom, &sem);   if (res)   {      printf("Error %u opening semaphore/n", res);      return 3;   }   res=DosRequestMutexSem(sem, 120000l);   if (res)   {      DosCloseMutexSem(sem);      if (res==ERROR_TIMEOUT)      {         printf("Timeout waiting for AM4PM to release COM port/n");         return 4;      }      printf("Error %u waiting for semaphore/n", res);      return 3;   }   DosReleaseMutexSem(sem);   DosCloseMutexSem(sem);   return 0;}
开发者ID:OS2World,项目名称:APP-COMM-AM4PM,代码行数:34,


示例12: MCIDRVSave

RC MCIDRVSave (FUNCTION_PARM_BLOCK *pFuncBlock){  ULONG                ulrc = MCIERR_SUCCESS;    // Propogated Error Code  ULONG                ulParam1;                 // Message flags  PMCI_INFO_PARMS      pInfoParms;               // Pointer to info structure  PMCI_GENERIC_PARMS   pDrvSaveParms;            // Pointer to GENERIC structure  PINSTANCE            pInstance;                // Pointer to instance  /*****************************************************/  /* dereference the values from pFuncBlock            */  /*****************************************************/  ulParam1       = pFuncBlock->ulParam1;  pInstance      = pFuncBlock->pInstance;  pDrvSaveParms     = (PMCI_GENERIC_PARMS)pFuncBlock->pParam2;  /*****************************************************/  /* NOTE ----->>>                                     */  /*  This is the basic function that should be        */  /*  performed.  See the other samples in the toolkit */  /*  for streaming and MMIO considerations            */  /*****************************************************/  DosRequestMutexSem (pInstance->hmtxAccessSem, -2);  // wait for semaphore  pInstance->Active = FALSE;  DosReleaseMutexSem (pInstance->hmtxAccessSem);      // release semaphore  return (ulrc);}      /* end of MCIDRVSave */
开发者ID:MbqIIB,项目名称:DEV-SAMPLES-IBM_Dev_Toolkit_Samples,代码行数:29,


示例13: GetDefaultEditorPlugin

WaWEPlugin_p GetDefaultEditorPlugin(){  WaWEPlugin_p pResult = NULL;  WaWEPlugin_p pTemp;  // The default editor plugin is the edit plugin with the  // greatest iPluginImportance value!  if (DosRequestMutexSem(PluginListProtector_Sem, SEM_INDEFINITE_WAIT)==NO_ERROR)  {    pTemp = PluginListHead;    while (pTemp)    {      if (pTemp->iPluginType == WAWE_PLUGIN_TYPE_EDITOR)      {        if (!pResult) pResult = pTemp;        else          if (pResult->iPluginImportance < pTemp->iPluginImportance)            pResult = pTemp;      }      pTemp = pTemp->pNext;    }    DosReleaseMutexSem(PluginListProtector_Sem);  }  return pResult;}
开发者ID:OS2World,项目名称:MM-SOUND-WaWE,代码行数:27,


示例14: _cairo_os2_surface_acquire_dest_image

static cairo_status_t_cairo_os2_surface_acquire_dest_image (void                     *abstract_surface,                                       cairo_rectangle_int_t    *interest_rect,                                       cairo_image_surface_t   **image_out,                                       cairo_rectangle_int_t    *image_rect,                                       void                    **image_extra){    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);    /* Increase lend counter */    local_os2_surface->pixel_array_lend_count++;    *image_out = local_os2_surface->image_surface;    *image_extra = NULL;    image_rect->x = 0;    image_rect->y = 0;    image_rect->width = local_os2_surface->bitmap_info.cx;    image_rect->height = local_os2_surface->bitmap_info.cy;    DosReleaseMutexSem (local_os2_surface->hmtx_use_private_fields);    return CAIRO_STATUS_SUCCESS;}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:34,


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


示例16: set_volume

void set_volume(int vol){    ULONG rc;    if ((rc=DosRequestMutexSem(hmtxOC, SEM_INDEFINITE_WAIT)))    {        log_warning(dlog, "set_volume, DosRequestMutexSem rc=%i", rc);        return;    }    if (usDeviceID)    {        MCI_SET_PARMS  MciSetParms;        memset(&MciSetParms, 0, sizeof(MCI_SET_PARMS));        MciSetParms.ulLevel = vol;        MciSetParms.ulAudio = MCI_SET_AUDIO_ALL;        log_message(dlog, "Setting volume to %d%%", vol);        rc = mciSendCommand(usDeviceID, MCI_SET, MCI_WAIT|                            MCI_SET_VOLUME|MCI_SET_AUDIO,                            (PVOID) &MciSetParms, 0);        if (rc != MCIERR_SUCCESS)            sound_err(dlog, rc, "Setting up Volume (MCI_SET).");    }    volume=vol;    DosReleaseMutexSem(hmtxOC);}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:29,


示例17: SDL_CreateSemaphore

/* Create a semaphore */DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value){        SDL_sem *sem;        ULONG ulrc;        /* Allocate sem memory */        sem = (SDL_sem *)SDL_malloc(sizeof(*sem));        if ( sem ) {                /* Create the mutex semaphore */                ulrc = DosCreateMutexSem(NULL,&(sem->id),0,TRUE);                if ( ulrc ) {                        SDL_SetError("Couldn't create semaphore");                        SDL_free(sem);                        sem = NULL;                } else                {                    DosCreateEventSem(NULL, &(sem->changed), 0, FALSE);                    sem->value = initial_value;                    DosReleaseMutexSem(sem->id);                }        } else {                SDL_OutOfMemory();        }        return(sem);}
开发者ID:3bu1,项目名称:crossbridge,代码行数:26,


示例18: mute

void mute(int state){    ULONG rc;    if ((rc=DosRequestMutexSem(hmtxOC, SEM_INDEFINITE_WAIT)))    {        log_warning(dlog, "mute, DosRequestMutexSem rc=%i", rc);        return;    }    if (usDeviceID)    {        MCI_SET_PARMS MciSetParms;        memset(&MciSetParms, 0, sizeof(MCI_SET_PARMS));        MciSetParms.ulAudio = MCI_SET_AUDIO_ALL;        rc = mciSendCommand(usDeviceID, MCI_SET, MCI_WAIT|state|MCI_SET_AUDIO,                            (PVOID) &MciSetParms, 0);        if (rc != MCIERR_SUCCESS)            sound_err(dlog, rc, "Setting mute state (MCI_SET_ON/OFF).");    }    DosReleaseMutexSem(hmtxOC);    if (state==MCI_SET_ON)        set_volume(volume);}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:27,


示例19: os2MutexLeave

/*** The sqlite3_mutex_leave() routine exits a mutex that was** previously entered by the same thread.  The behavior** is undefined if the mutex is not currently entered or** is not currently allocated.  SQLite will never do either.*/static void os2MutexLeave(sqlite3_mutex *p){  assert( os2MutexHeld(p) );  DosReleaseMutexSem(p->mutex);#ifdef SQLITE_DEBUG  if( p->trace ) os2MutexTrace(p, "leave");#endif}
开发者ID:77songsong,项目名称:sqlite3,代码行数:13,


示例20: __objc_mutex_unlock

/* Unlock the mutex */int__objc_mutex_unlock(objc_mutex_t mutex){  if (DosReleaseMutexSem((HMTX)(mutex->backend)) != 0)    return -1;  else    return 0;}
开发者ID:DJHartley,项目名称:iphone-dev,代码行数:9,


示例21: DARTEvent

LONG APIENTRY DARTEvent (ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags){    ULONG rc;    switch (ulFlags)    {    case MIX_WRITE_COMPLETE:        //        // start the playback of the next buffer        //        rc=MixSetupParms.pmixWrite(MixSetupParms.ulMixHandle,                                   &(buffers[play]), 1);        //        // get the sound mutex        //        if (DosRequestMutexSem(hmtxSnd, SEM_INDEFINITE_WAIT))            return TRUE;        //        // empty the buffer which was finished        //        memset(buffers[last].pBuffer, 0, BufferParms.ulBufferSize);        //        // point to the next playable buffer and remember this buffer        // as the last one which was played        //        last  = play++;        play %= BufferParms.ulNumBuffers;        //        // release mutex        //        DosReleaseMutexSem(hmtxSnd);        if (rc != MCIERR_SUCCESS)            sound_err(dlog, rc, "Writing to Mixer (pmixWrite, MIX_WRITE_COMPLETE).");        return TRUE;    case MIX_STREAM_ERROR | MIX_WRITE_COMPLETE: // 130  /* error occur in device */        switch (ulStatus)        {        case ERROR_DEVICE_UNDERRUN: // 5626            sound_err(dlog, ulStatus, "Device underrun.");            play += 2;            play %= BufferParms.ulNumBuffers;            break;        case ERROR_DEVICE_OVERRUN:  // 5627            sound_err(dlog, ulStatus, "Device overrun.");            break;        }        rc=MixSetupParms.pmixWrite(MixSetupParms.ulMixHandle,                                   &(buffers[play]), 1);        if (rc != MCIERR_SUCCESS)            sound_err(dlog, rc, "Writing to Mixer (pmixWrite, MIX_STREAM_ERROR).");        return TRUE;    }    return TRUE;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:58,


示例22: que_n

int que_n (void){    int result;    DosRequestMutexSem (mtx_Queue, SEM_INDEFINITE_WAIT);    result = nq;    DosReleaseMutexSem (mtx_Queue);    return result;}
开发者ID:OS2World,项目名称:LIB-libfly,代码行数:9,


示例23: IsMessageMarked

BOOL IsMessageMarked(PMARKERLIST pList, PCHAR pchAreaTag, ULONG ulMsgID, ULONG ulFlags){   PMARKERAREA pArea;   PMARKERBUCKET pBucket;   LONG lFoundIndex;   WinRequestMutexSem(pList->hmtxAccess, SEM_INDEFINITE_WAIT);   /* Area suchen */   pArea = FindMarkerArea(pList, pchAreaTag);   if (pArea)   {      /* Area nach vorne setzen */      SetAreaToFront(pList, pArea);      /* Message in den Buckets suchen */      pBucket = FindMarkerBucket(pArea, ulMsgID, &lFoundIndex);      if (pBucket && lFoundIndex >=0)      {         /* Flags pruefen */         if (pBucket->aItems[lFoundIndex].ulFlags & ulFlags)         {            DosReleaseMutexSem(pList->hmtxAccess);            return TRUE;         }         else         {            DosReleaseMutexSem(pList->hmtxAccess);            return FALSE;         }      }      else      {         DosReleaseMutexSem(pList->hmtxAccess);         return FALSE;      }   }   else   {      DosReleaseMutexSem(pList->hmtxAccess);      return FALSE;   }}
开发者ID:OS2World,项目名称:APP-COMM-FleetStreet,代码行数:44,


示例24: dart_write2

static int dart_write2(SWORD *pbuf, size_t nr){    APIRET rc;    int nrtowrite;    written += nr;    nr *= sizeof(SWORD);    while (nr)    {        //        // check if the buffer can be filled completely        //        nrtowrite = nr>rest ? rest : nr;        if ((rc=DosRequestMutexSem(hmtxSnd, SEM_INDEFINITE_WAIT)))        {            log_warning(dlog, "dart_write2, DosRequestMutexSem rc=%i", rc);            return 1;        }        //        // if the buffer we want to write to is the next one which is        // played, skip one buffer and write to the overnext        //        if (play==(pos+1)%BufferParms.ulNumBuffers)        {            pos      = (++pos)%BufferParms.ulNumBuffers;            written += BufferParms.ulBufferSize/sizeof(SWORD);        }        //        // fill the pos-th buffer        //        memcpy((void*)((ULONG)buffers[pos].pBuffer+(BufferParms.ulBufferSize-rest)),               pbuf, nrtowrite);        rest -= nrtowrite;        //        // check if the buffer was filled completely        //        if (!rest)        {            pos++;            pos %= BufferParms.ulNumBuffers;            rest = BufferParms.ulBufferSize;        }        DosReleaseMutexSem(hmtxSnd);        nr -= nrtowrite;    }    return 0;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:56,


示例25: global_unlock

/** * Releases the global mutex requested by global_lock(). */void global_unlock(){  APIRET arc;  ASSERT(gMutex != NULLHANDLE);  arc = DosReleaseMutexSem(gMutex);  ASSERT_MSG(arc == NO_ERROR, "%ld", arc);}
开发者ID:bitwiseworks,项目名称:libcx,代码行数:13,


示例26: joy_arch_init

/* Initialize joystick support.  */int joy_arch_init(void){    ULONG action;    // return value from DosOpen    APIRET rc;    if (SWhGame)        return 0;    joylog = log_open("Joystick");    archdep_create_mutex_sem(&hmtxJoystick, "Joystick", TRUE);    number_joysticks = JOYDEV_NONE;    if (rc=DosOpen("GAME$", &SWhGame, &action, 0,                   FILE_READONLY, OPEN_ACTION_OPEN_IF_EXISTS/*FILE_OPEN*/,                   OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, NULL))    {        if (rc==ERROR_OPEN_FAILED)        {            log_warning(joylog, "Cannot open device 'GAME$'.");            log_warning(joylog, "Have you installed a MPPM/2 joystick device driver?/n");        }        else            log_error(joylog, "DosOpen 'GAME$' (rc=%i)", rc);    }    else    {    	GAME_PARM_STRUCT parms;        ULONG dataLen = sizeof(parms); // length of gameStatus        if (rc=DosDevIOCtl(SWhGame, IOCTL_CAT_USER, GAME_GET_PARMS,                           NULL, 0, NULL, &parms, dataLen, &dataLen))        {            log_error(joylog, "DosDevIOCtl (rc=%i)", rc);        }        else        {            if (parms.useA)            {                log_message(joylog, "Joystick A found.");                number_joysticks |= JOYDEV_HW1;            }            if (parms.useB)            {                log_message(joylog, "Joystick B found.");                number_joysticks |= JOYDEV_HW2;            }            if (number_joysticks==JOYDEV_NONE)                log_message(joylog, "Sorry, no joystick found!");        }    }    DosReleaseMutexSem(hmtxJoystick);    return 0;}
开发者ID:martinpiper,项目名称:VICE,代码行数:55,


示例27: sqlite3_mutex_leave

/*** The sqlite3_mutex_leave() routine exits a mutex that was** previously entered by the same thread.  The behavior** is undefined if the mutex is not currently entered or** is not currently allocated.  SQLite will never do either.*/void sqlite3_mutex_leave(sqlite3_mutex *p){  TID tid;  PID holder1;  ULONG holder2;  assert( p->nRef>0 );  DosQueryMutexSem(p->mutex, &holder1, &tid, &holder2);  assert( p->owner==tid );  p->nRef--;  assert( p->nRef==0 || p->id==SQLITE_MUTEX_RECURSIVE );  DosReleaseMutexSem(p->mutex);}
开发者ID:riseven,项目名称:ri7engine,代码行数:17,


示例28: RTDECL

RTDECL(int)  RTSemMutexRelease(RTSEMMUTEX hMutexSem){    /*     * Unlock mutex semaphore.     */    int rc = DosReleaseMutexSem(SEM2HND(hMutexSem));    if (!rc)        return VINF_SUCCESS;    AssertMsgFailed(("Release hMutexSem %p failed, rc=%d/n", hMutexSem, rc));    return RTErrConvertFromOS2(rc);}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:11,


示例29: pthread_mutex_unlock

int DLLCALL pthread_mutex_unlock(pthread_mutex_t* mutex){#if defined(PTHREAD_MUTEX_AS_WIN32_MUTEX)	return (ReleaseMutex(*mutex) ? 0 : GetLastError());#elif defined(_WIN32)	/* Win32 Critical Section */	LeaveCriticalSection(mutex);	return 0;	/* No error */#elif defined(__OS2__)	return DosReleaseMutexSem(*mutex);#endif}
开发者ID:carriercomm,项目名称:syncfoss,代码行数:11,


示例30: DosRequestMutexSem

int GUI::SetPipeView(int id, EModel *notify) {  if ((id < 0) || (id > MAX_PIPES)) return -1;  if (Pipes[id].used == 0) return -1;  DosRequestMutexSem(Pipes[id].Access, SEM_INDEFINITE_WAIT);  // fprintf(stderr, "Pipe View: %d %08X/n", id, notify);  Pipes[id].notify = notify;  DosReleaseMutexSem(Pipes[id].Access);  return 0;}
开发者ID:AaronDP,项目名称:efte_adbshell,代码行数:12,



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


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