Ignore:
Timestamp:
Mar 19, 2001, 9:31:25 PM (24 years ago)
Author:
umoeller
Message:

misc changes

File:
1 edited

Legend:

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

    r44 r49  
    139139            // "Wait" flag set: thrCreate is then
    140140            // waiting on the wait event sem posted
     141                    // do not post if THRF_WAIT_EXPLICIT!
    141142            DosPostEventSem(pti->hevRunning);
    142143
     
    161162            ((PTHREADFUNC)pti->pThreadFunc)(pti);
    162163
    163         if (pti->flFlags & THRF_WAIT)
     164        if (pti->flFlags & (THRF_WAIT | THRF_WAIT_EXPLICIT))    // V0.9.9 (2001-03-14) [umoeller]
    164165            // "Wait" flag set: delete semaphore
    165166            DosCloseEventSem(pti->hevRunning);
     
    250251 *         typical PM "Worker" thread where you need to disable
    251252 *         menu items on thread 1 while the thread is running.
     253 *
     254 *      -- THRF_WAIT_EXPLICIT: like THRF_WAIT, but in this case,
     255 *         your thread function must post THREADINFO.hevRunning
     256 *         yourself (thr_fntGeneric will not automatically
     257 *         post it). Useful for waiting until your own thread
     258 *         function is fully initialized, e.g. if it creates
     259 *         an object window.
     260 *
     261 *         WARNING: if your thread forgets to post this, we'll
     262 *         hang.
     263 *
     264 *         Added V0.9.9 (2001-03-14) [umoeller].
    252265 *
    253266 *      -- THRF_TRANSIENT: creates a "transient" thread where
     
    269282 *@@changed V0.9.9 (2001-02-06) [umoeller]: now returning TID
    270283 *@@changed V0.9.9 (2001-03-07) [umoeller]: added pcszThreadName
     284 *@@changed V0.9.9 (2001-03-14) [umoeller]: added THRF_WAIT_EXPLICIT
    271285 */
    272286
     
    299313        pti->ulData = ulData;
    300314
    301         if (flFlags & THRF_WAIT)
     315        if (flFlags & (THRF_WAIT | THRF_WAIT_EXPLICIT)) // V0.9.9 (2001-03-14) [umoeller]
    302316            // "Wait" flag set: create an event semaphore which
    303             // will be posted by thr_fntGeneric
     317            // will be posted by thr_fntGeneric (THRF_WAIT only)
    304318            if (DosCreateEventSem(NULL,     // unnamed
    305319                                  &pti->hevRunning,
     
    332346                }
    333347
    334                 if (flFlags & THRF_WAIT)
     348                if (flFlags & (THRF_WAIT | THRF_WAIT_EXPLICIT))
    335349                {
    336350                    // "Wait" flag set: wait on event semaphore
    337                     // posted by thr_fntGeneric
    338351                    DosWaitEventSem(pti->hevRunning,
    339352                                    SEM_INDEFINITE_WAIT);
Note: See TracChangeset for help on using the changeset viewer.