Ignore:
Timestamp:
Jun 22, 2001, 9:40:28 PM (24 years ago)
Author:
sandervl
Message:

semaphore update

File:
1 edited

Legend:

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

    r6049 r6069  
    1 /* $Id: HandleManager.cpp,v 1.65 2001-06-19 10:50:23 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.66 2001-06-22 19:40:27 sandervl Exp $ */
    22
    33/*
     
    19131913
    19141914          while(TRUE) {
    1915               dwResult = O32_MsgWaitForMultipleObjects(1, &hObject, FALSE,
    1916                                                        INFINITE, QS_ALLINPUT);
     1915              dwResult = HMMsgWaitForMultipleObjects(1, &hObject, FALSE,
     1916                                                     INFINITE, QS_ALLINPUT);
    19171917              if(dwResult == WAIT_OBJECT_0 + 1) {
    19181918                  MSG msg ;
     
    19481948  }
    19491949
    1950   // @@@PH Problem: wrong class (base class) is called instead of
    1951   //                open32 class ?! Why ?!
    19521950  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
    19531951  dwResult = pHMHandle->pDeviceHandler->WaitForSingleObject(&pHMHandle->hmHandleData,
     
    28772875                                DWORD   dwTimeout)
    28782876{
     2877#ifdef USE_OS2SEMAPHORES
     2878  int       iIndex;                           /* index into the handle table */
     2879  DWORD     dwResult;                /* result from the device handler's API */
     2880  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     2881
     2882  if(cObjects == 1) {
     2883      return HMWaitForSingleObject(*lphObjects, dwTimeout);
     2884  }
     2885                                                          /* validate handle */
     2886  iIndex = _HMHandleQuery(*lphObjects);                   /* get the index */
     2887  if (-1 == iIndex)                                       /* error ? */
     2888  {//oh, oh. possible problem here
     2889   //TODO: rewrite handling of other handles; don't forward to open32
     2890      dprintf(("WANRING: HMWaitForMultipleObjects: unknown handle passed on to Open32 -> will not work if other handles are semaphores"));
     2891      return O32_WaitForMultipleObjects(cObjects, lphObjects, fWaitAll, dwTimeout);
     2892  }
     2893
     2894  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     2895  dwResult = pHMHandle->pDeviceHandler->WaitForMultipleObjects(&pHMHandle->hmHandleData,
     2896                                                               cObjects, lphObjects, fWaitAll,
     2897                                                               dwTimeout);
     2898
     2899  return (dwResult);                                  /* deliver return code */
     2900#else
    28792901  ULONG   ulIndex;
    28802902  PHANDLE pArrayOfHandles;
     
    29332955
    29342956  return (rc);                            // OK, done
     2957#endif
    29352958}
    29362959
     
    29732996 *****************************************************************************/
    29742997
    2975 DWORD  HMMsgWaitForMultipleObjects  (DWORD      nCount,
    2976                                      LPHANDLE       pHandles,
     2998DWORD  HMMsgWaitForMultipleObjects  (DWORD      cObjects,
     2999                                     LPHANDLE   lphObjects,
    29773000                                     BOOL       fWaitAll,
    2978                                      DWORD      dwMilliseconds,
     3001                                     DWORD      dwTimeout,
    29793002                                     DWORD      dwWakeMask)
    29803003{
     3004#ifdef USE_OS2SEMAPHORES
     3005  int       iIndex;                           /* index into the handle table */
     3006  DWORD     dwResult;                /* result from the device handler's API */
     3007  PHMHANDLE pHMHandle;       /* pointer to the handle structure in the table */
     3008
     3009                                                          /* validate handle */
     3010  iIndex = _HMHandleQuery(*lphObjects);                   /* get the index */
     3011  if (-1 == iIndex)                                       /* error ? */
     3012  {//oh, oh. possible problem here
     3013   //TODO: rewrite handling of other handles; don't forward to open32
     3014      dprintf(("WANRING: HMWaitForMultipleObjects: unknown handle passed on to Open32 -> will not work if other handles are semaphores"));
     3015      return O32_MsgWaitForMultipleObjects(cObjects, lphObjects, fWaitAll, dwTimeout, dwWakeMask);
     3016  }
     3017
     3018  pHMHandle = &TabWin32Handles[iIndex];               /* call device handler */
     3019  dwResult = pHMHandle->pDeviceHandler->MsgWaitForMultipleObjects(&pHMHandle->hmHandleData,
     3020                                                                  cObjects, lphObjects, fWaitAll,
     3021                                                                  dwTimeout, dwWakeMask);
     3022
     3023  return (dwResult);                                  /* deliver return code */
     3024#else
    29813025  ULONG   ulIndex;
    29823026  PHANDLE pArrayOfHandles;
     
    30303074
    30313075  return (rc);                            // OK, done
     3076#endif
    30323077}
    30333078/*****************************************************************************
Note: See TracChangeset for help on using the changeset viewer.