home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_11 / 8n11036b < prev    next >
Text File  |  1990-09-19  |  607b  |  25 lines

  1.  
  2.  
  3.  
  4.          #include <os2.h>
  5.  
  6.          SHORT GetUpdateAppCounter(SHORT sUpdCnt)
  7.          {
  8.              auto     USHORT       usRC;
  9.              auto     SHORT        sInstCnt;
  10.              static   SHORT        sCounter = 0;
  11.              static   ULONG        ulSem    = 0L;
  12.  
  13.              usRC = DosSemRequest(&ulSem, SEM_INDEFINATE_WAIT);
  14.              if (usRC)
  15.                  ErrorMsg("GetUpdateAppCounter", usRC);  // no return
  16.              sCounter += sUpdCnt;
  17.              sInstCnt  = sCounter;
  18.  
  19.              DosSemClear(&ulSem);
  20.              return(sInstCnt);
  21.          }
  22.  
  23.  
  24.  
  25.