Changeset 3796 for trunk


Ignore:
Timestamp:
May 24, 2012, 10:06:49 PM (13 years ago)
Author:
bird
Message:

Comment fixes from Steven. Fixes #258.

Location:
trunk/libc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/include

  • trunk/libc/include/InnoTekLIBC/fork.h

    r2806 r3796  
    412412     * This is only set when fork() is called from threads other than 1. */
    413413    int                     fStackAlloc;
    414     /** Pointer to the instruction starint the return sequence for __fork().
     414    /** Pointer to the instruction starting the return sequence for __fork().
    415415     * Pratically speaking, set esp=pvStackRet and jump here. */
    416416    void                   *pvForkRet;
  • trunk/libc/src/kNIX/os2

  • trunk/libc/src/kNIX/os2/libcfork.c

    r3050 r3796  
    487487        /*
    488488         * Don't deregister modules which has already been deregistered.
    489          * Don't deregister if we're in shutting down the process (waste 
     489         * Don't deregister if we're in shutting down the process (waste
    490490         * of time and SPM will already be shut down).
    491491         */
     
    615615
    616616    /*
    617      * Determin fxsave/fxrstor support.
     617     * Determine fxsave/fxrstor support.
    618618     */
    619619    static int fHaveFXSR = -1;
     
    762762    /*
    763763     * Check if we have an executable in the module list.
    764      * It's impossible to pull of a fork without the executable being ready for it!
     764     * It's impossible to pull off a fork without the executable being ready for it!
    765765     */
    766766    if (forkParCanFork(pModules))
     
    10221022 * will go directly into wait on the mutex. I.e. the event sems are only used
    10231023 * for accessing the mutex, and the mutex is the semaphore to wait on. This is
    1024  * much more reliable than sleeping on event sems, since mutex sems gets
    1025  * invalidate if an owner dies.
     1024 * much more reliable than sleeping on event sems, since mutex sems get
     1025 * invalidated if an owner dies.
    10261026 *
    10271027 * The handle is created with buffer flushing disabled.
     
    11961196 * child run.
    11971197 *
    1198  * The for buffer will be released before DosExecPgm() so the child can
     1198 * The fork buffer will be released before DosExecPgm() so the child can
    11991199 * do init time processing of the DosEx stuff for instance. After DosExecPgm()
    12001200 * we'll be wait on the event semaphore and subseqently on the mutex till
     
    24522452
    24532453    /*
    2454      * Rest the buffer.
     2454     * Reset the buffer.
    24552455     */
    24562456    if (rc >= 0)
  • trunk/libc/src/kNIX/os2/sharedpm.c

    r3782 r3796  
    464464            LIBCLOG_MSG("posting %#lx\n", gpSPMHdr->hevNotify);
    465465            APIRET rc2 = DosPostEventSem(gpSPMHdr->hevNotify);
    466             spmReleaseMutex(&RegRec); 
     466            spmReleaseMutex(&RegRec);
    467467            LIBC_ASSERTM(!rc2 || rc2 == ERROR_ALREADY_POSTED, "rc2=%ld!\n", rc2); rc2 = rc2;
    468468        }
     
    600600
    601601/**
    602  * Wait for a embryo to become a live process and complete 
     602 * Wait for a embryo to become a live process and complete
    603603 * inheriting (file handles / sockets issues).
    604604 *
     
    617617    DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulStart, sizeof(ulStart));
    618618
    619     /* 
     619    /*
    620620     * Wait for the process to become ready, 8 ms max.
    621      * However, if it becomes alive in that period we know it's a libc 
     621     * However, if it becomes alive in that period we know it's a libc
    622622     * process and will wait a bit more (130 ms) for it to finishing
    623623     * initialization and inheritance.
    624624     */
    625     for (cLoops = 0; ; cLoops++) 
    626     {
    627         /* 
    628          * Reset the notification event sem. 
     625    for (cLoops = 0; ; cLoops++)
     626    {
     627        /*
     628         * Reset the notification event sem.
    629629         */
    630630        spmRequestMutex(&RegRec);
    631631        fAlive = pEmbryo->enmState > __LIBC_PROCSTATE_ALIVE
    632               || (   pEmbryo->pInherit == NULL 
     632              || (   pEmbryo->pInherit == NULL
    633633                  && pEmbryo->pInheritLocked == NULL
    634634                  && pEmbryo->enmState == __LIBC_PROCSTATE_ALIVE);
     
    639639            break; /* done */
    640640
    641         /* 
    642          * Calc the time we should sleep. 
     641        /*
     642         * Calc the time we should sleep.
    643643         */
    644644        ULONG ulNow = 0;
     
    659659            LIBCLOG_MSG("libc child - wait %lu ms (cLoops=%d rc=%ld)\n", ulSleep, cLoops, rc);
    660660        }
    661         else 
     661        else
    662662            break; /* giving up */
    663663
    664         /* 
    665          * Recheck before going to sleep on the event sem. 
     664        /*
     665         * Recheck before going to sleep on the event sem.
    666666         */
    667667        fAlive = pEmbryo->enmState > __LIBC_PROCSTATE_ALIVE
    668               || (   pEmbryo->pInherit == NULL 
     668              || (   pEmbryo->pInherit == NULL
    669669                  && pEmbryo->pInheritLocked == NULL
    670670                  && pEmbryo->enmState == __LIBC_PROCSTATE_ALIVE);
     
    672672            break; /* done */
    673673
    674         if (    gpSPMHdr->hevNotify 
     674        if (    gpSPMHdr->hevNotify
    675675            &&  (rc == NO_ERROR || rc == ERROR_TIMEOUT || rc == ERROR_SEM_TIMEOUT))
    676676            rc = DosWaitEventSem(gpSPMHdr->hevNotify, ulSleep);
     
    26332633                    *pParent->ppChildNotifyTail = pTerm;
    26342634                    pParent->ppChildNotifyTail = &pTerm->pNext;
    2635                    
     2635
    26362636                    LIBCLOG_MSG("posting %#lx\n", gpSPMHdr->hevNotify);
    26372637                    APIRET rc2 = DosPostEventSem(gpSPMHdr->hevNotify);
     
    34623462                    spmFreeProcess(pProcess);
    34633463                    pProcess = pProcessNext;
    3464                    
     3464
    34653465                    /* Wake up the embryo waiters (paranoia). */
    34663466                    LIBCLOG_MSG("posting %#lx\n", gpSPMHdr->hevNotify);
     
    35583558                        spmFreeProcess(pProcess);
    35593559                        pProcess = pProcessNext;
    3560                        
     3560
    35613561                        /* Wake up the embryo waiters (paranoia). */
    35623562                        LIBCLOG_MSG("posting %#lx\n", gpSPMHdr->hevNotify);
  • trunk/libc/src/kNIX/os2/signals.c

    r2942 r3796  
    848848
    849849    /*
    850      * Can't be to careful!
     850     * Can't be too careful!
    851851     */
    852852    LIBC_ASSERTM(!__libc_back_signalSemIsOwner(), "Thread owns the signal semaphore!!! Bad boy!!\n");
Note: See TracChangeset for help on using the changeset viewer.