Ignore:
Timestamp:
Aug 31, 1999, 6:41:48 PM (26 years ago)
Author:
phaller
Message:

Fix: MM-timers should now use correct calling convention

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/os2timer.cpp

    r758 r759  
    1 /* $Id: os2timer.cpp,v 1.10 1999-08-31 15:47:48 phaller Exp $ */
     1/* $Id: os2timer.cpp,v 1.11 1999-08-31 16:41:48 phaller Exp $ */
    22
    33/*
     
    3535
    3636
     37/***********************************
     38 * PH: fixups for missing os2win.h *
     39 ***********************************/
     40
     41extern "C"
     42{
     43  typedef DWORD (* CALLBACK LPTHREAD_START_ROUTINE)(LPVOID);
     44
     45  HANDLE WIN32API CreateThread(LPSECURITY_ATTRIBUTES lpsa,
     46                               DWORD cbStack,
     47                               LPTHREAD_START_ROUTINE lpStartAddr,
     48                               LPVOID lpvThreadParm,
     49                               DWORD fdwCreate,
     50                               LPDWORD lpIDThread);
     51}
     52
    3753/****************************************************************************
    3854 * Local Prototypes                                                         *
    3955 ****************************************************************************/
    4056
    41 static void _Optlink TimerHlpHandler(void *);
    42 
     57static DWORD _System TimerHlpHandler(LPVOID timer);
    4358
    4459
     
    206221                  clientCallback(NULL), TimerStatus(Stopped), fFatal(FALSE)
    207222{
    208  OS2Timer *timer = OS2Timer::timers;
     223  OS2Timer *timer = OS2Timer::timers;
    209224
    210225  if(timer != NULL)
     
    219234    timers = this;
    220235
    221   TimerThreadID = _beginthread(TimerHlpHandler, NULL, 0x4000, (void *)this);
     236  //TimerThreadID = _beginthread(TimerHlpHandler, NULL, 0x4000, (void *)this);
     237  hTimerThread = CreateThread(NULL,
     238                              0x1000,
     239                              (LPTHREAD_START_ROUTINE)TimerHlpHandler,
     240                              (LPVOID)this,
     241                              0, // thread creation flags
     242                              &TimerThreadID);
     243
     244
     245  //@@@PH: CreateThread() should be used instead
    222246  //@@@PH: logic sux ... waits for creation of semaphores
    223247  DosSleep(100);
     
    329353  {
    330354    dprintf(("WINMM: OS2Timer: DosCreateEventSem failed rc=#%08xh\n", rc));
    331       _endthread();
     355    return; // terminate thread
    332356  }
    333357
     
    352376//******************************************************************************
    353377//******************************************************************************
    354 static void _Optlink TimerHlpHandler(void *timer)
     378//static void _Optlink TimerHlpHandler(void *timer)
     379static DWORD _System TimerHlpHandler(LPVOID timer)
    355380{
    356381  ((OS2Timer *)timer)->TimerHandler();
    357382
    358   _endthread();
     383  //_endthread(); isn't really required
     384  return 0;
    359385}
    360386
Note: See TracChangeset for help on using the changeset viewer.