Ignore:
Timestamp:
Jun 23, 2001, 6:59:28 PM (24 years ago)
Author:
sandervl
Message:

semaphore updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/hmevent.cpp

    r6069 r6084  
    1 /* $Id: hmevent.cpp,v 1.7 2001-06-22 19:40:28 sandervl Exp $ */
     1/* $Id: hmevent.cpp,v 1.8 2001-06-23 16:59:27 sandervl Exp $ */
    22
    33/*
     
    4848#include "HandleManager.H"
    4949#include "HMEvent.h"
     50#include "HMSemaphore.h"
    5051#include "oslibdos.h"
    5152
     
    108109      strcat(szSemName, lpszEventName);
    109110      lpszEventName = szSemName;
     111      FixSemName((char *)lpszEventName);
    110112  }
    111113  //Manual reset means all threads waiting on the event semaphore will be
     
    183185  strcpy(szSemName, "\\SEM32\\");
    184186  strcat(szSemName, lpszEventName);
     187  FixSemName(szSemName);
    185188  rc = DosOpenEventSem(szSemName, &hev);
    186189  if(rc) {
     
    394397                                                    DWORD      dwWakeMask)
    395398{
    396     dprintf(("KERNEL32: ERROR: HandleManager::DeviceHandler::MsgWaitForMultipleObjects %08x %d %x %d %d %x",
    397               pHMHandleData->hHMHandle, nCount, pHandles, fWaitAll, dwMilliseconds, dwWakeMask));
    398 
    399     if(!(pHMHandleData->dwAccess & SYNCHRONIZE_W) )
    400     {
    401         dprintf(("ERROR: Access denied!!"));
    402         SetLastError(ERROR_ACCESS_DENIED_W);
    403         return WAIT_FAILED_W;
    404     }
    405 
    406     return WAIT_FAILED_W;
     399    return HMSemMsgWaitForMultipleObjects(nCount, pHandles, fWaitAll, dwMilliseconds, dwWakeMask);
    407400}
    408401#endif
     
    425418                                                 DWORD   dwTimeout)
    426419{
    427     dprintf(("KERNEL32: ERROR: HandleManager::DeviceHandler::WaitForMultipleObjects %08x %d %x %d %x",
    428               pHMHandleData->hHMHandle, cObjects, lphObjects, fWaitAll, dwTimeout));
    429 
    430     if(!(pHMHandleData->dwAccess & SYNCHRONIZE_W) )
    431     {
    432         dprintf(("ERROR: Access denied!!"));
    433         SetLastError(ERROR_ACCESS_DENIED_W);
    434         return WAIT_FAILED_W;
    435     }
    436 
    437     return WAIT_FAILED_W;
     420    return HMSemWaitForMultipleObjects(cObjects, lphObjects, fWaitAll, dwTimeout);
    438421}
    439422#endif
     
    467450
    468451  rc = DosPostEventSem(pHMHandleData->hHMHandle);
    469   if(rc) {
     452  if(rc && rc != ERROR_ALREADY_POSTED) {
    470453      dprintf(("DosPostEventSem %x failed with rc %d", pHMHandleData->hHMHandle, rc));
    471454      SetLastError(error2WinError(rc));
     
    512495
    513496  rc = DosPostEventSem(pHMHandleData->hHMHandle);
    514   if(rc) {
     497  if(rc && rc != ERROR_ALREADY_POSTED) {
    515498      dprintf(("DosPostEventSem %x failed with rc %d", pHMHandleData->hHMHandle, rc));
    516499      SetLastError(error2WinError(rc));
     
    519502  if(pHMHandleData->dwFlags == TRUE) {//fManualReset
    520503      rc = DosResetEventSem(pHMHandleData->hHMHandle, &count);
    521       if(rc) {
     504      if(rc && rc != ERROR_ALREADY_RESET) {
    522505          dprintf(("DosResetEventSem %x failed with rc %d", pHMHandleData->hHMHandle, rc));
    523506          SetLastError(error2WinError(rc));
     
    565548
    566549  rc = DosResetEventSem(pHMHandleData->hHMHandle, &count);
    567   if(rc) {
     550  if(rc && rc != ERROR_ALREADY_RESET) {
    568551      dprintf(("DosResetEventSem %x failed with rc %d", pHMHandleData->hHMHandle, rc));
    569552      SetLastError(error2WinError(rc));
Note: See TracChangeset for help on using the changeset viewer.