Ignore:
Timestamp:
Jan 14, 2001, 5:42:22 PM (25 years ago)
Author:
umoeller
Message:

Misc. updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/threads.c

    r21 r22  
    296296                                      0,
    297297                                      NULL);
    298     THREADINFO  ti = {0};
    299     thrCreate(&ti,
    300               pfn,
    301               NULL,
    302               THRF_PMMSGQUEUE,
    303               ulData);
    304     ti.hwndNotify = hwndNotify;
    305 
    306     while (WinGetMsg(hab,
    307                      &qmsg, 0, 0, 0))
    308     {
    309         // current message for our object window?
    310         if (    (qmsg.hwnd == hwndNotify)
    311              && (qmsg.msg == WM_USER)
    312            )
     298    if (hwndNotify)
     299    {
     300        THREADINFO  ti = {0};
     301        thrCreate(&ti,
     302                  pfn,
     303                  NULL,
     304                  THRF_PMMSGQUEUE,
     305                  ulData);
     306        ti.hwndNotify = hwndNotify;
     307
     308        while (WinGetMsg(hab,
     309                         &qmsg, 0, 0, 0))
    313310        {
    314             fQuit = TRUE;
    315             ulrc = (ULONG)qmsg.mp1;
     311            // current message for our object window?
     312            if (    (qmsg.hwnd == hwndNotify)
     313                 && (qmsg.msg == WM_USER)
     314               )
     315            {
     316                fQuit = TRUE;
     317                ulrc = (ULONG)qmsg.mp1;
     318            }
     319
     320            WinDispatchMsg(hab, &qmsg);
     321            if (fQuit)
     322                break;
    316323        }
    317324
    318         WinDispatchMsg(hab, &qmsg);
    319         if (fQuit)
    320             break;
    321     }
    322 
    323     // we must wait for the thread to finish, or
    324     // otherwise THREADINFO is deleted from the stack
    325     // before the thread exits... will crash!
    326     thrWait(&ti);
    327 
    328     WinDestroyWindow(hwndNotify);
     325        // we must wait for the thread to finish, or
     326        // otherwise THREADINFO is deleted from the stack
     327        // before the thread exits... will crash!
     328        thrWait(&ti);
     329
     330        WinDestroyWindow(hwndNotify);
     331    }
     332
    329333    return (ulrc);
    330334}
     
    367371        if (pti->tid)
    368372        {
    369             DosWaitThread(&(pti->tid), DCWW_WAIT);
     373            DosWaitThread(&pti->tid, DCWW_WAIT);
    370374            pti->tid = NULLHANDLE;
    371375            return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.