Changeset 329 for trunk/dll/timer.c


Ignore:
Timestamp:
Jul 25, 2006, 8:39:11 PM (19 years ago)
Author:
root
Message:

Check more run time errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/timer.c

    r2 r329  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Timer thread
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2006 Steven H. Levine
     10
     11  22 Jul 06 SHL Check more run time errors
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_DOSERRORS
    317#define INCL_WIN
     18#include <os2.h>
    419
    5 #include <os2.h>
    620#include <stdarg.h>
    721#include <stdio.h>
    822#include <stdlib.h>
    923#include <string.h>
     24
    1025#include "fm3dll.h"
    1126#include "fm3str.h"
     
    1328#pragma alloc_text(TIMER,TimerThread,StartTimer,StopTimer)
    1429
     30static PSZ pszSrcFile = __FILE__;
     31
    1532static HEV hevTimerSem;
    1633
    17 
    18 static void TimerThread (void *args) {
    19 
     34static void TimerThread (void *args)
     35{
    2036  HAB   hab2;
    2137  HMQ   hmq2;
     
    6682}
    6783
    68 BOOL StartTimer (void) {
     84//== StartTimer() return TRUE can start thread ==
    6985
    70   return (_beginthread(TimerThread,
    71                        NULL,
    72                        32768,
    73                        (PVOID)0) != -1);
     86BOOL StartTimer (void)
     87{
     88  INT rc = _beginthread(TimerThread,NULL,32768,(PVOID)0);
     89
     90  if (rc == -1)
     91    Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT));
     92
     93  return rc != -1;
    7494}
    7595
    76 void StopTimer (void) {
    77 
     96void StopTimer (void)
     97{
    7898  DosPostEventSem(hevTimerSem);
    7999}
Note: See TracChangeset for help on using the changeset viewer.