Changeset 22 for trunk/src/helpers/threads.c
- Timestamp:
- Jan 14, 2001, 5:42:22 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/threads.c
r21 r22 296 296 0, 297 297 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)) 313 310 { 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; 316 323 } 317 324 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 329 333 return (ulrc); 330 334 } … … 367 371 if (pti->tid) 368 372 { 369 DosWaitThread(& (pti->tid), DCWW_WAIT);373 DosWaitThread(&pti->tid, DCWW_WAIT); 370 374 pti->tid = NULLHANDLE; 371 375 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.