Changeset 1884


Ignore:
Timestamp:
Apr 24, 2005, 4:12:08 AM (20 years ago)
Author:
bird
Message:

not internal threads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/emx/src/lib/process/beginthr.c

    • Property cvs2svn:cvs-rev changed from 1.14 to 1.15
    r1883 r1884  
    5858
    5959    /*
    60      * Initialize the minimum stack mark on the first call run.
     60     * Adjust the stack size, omit internal threads.
    6161     */
    62     static size_t   cbStackMin;
    63     if (!cbStackMin)
     62    if (!fInternal)
    6463    {
    65         const char *psz = getenv("LIBC_THREAD_MIN_STACK_SIZE");
    66         int cb = 4096;
    67         if (psz)
     64        /* Initialize the minimum stack mark on the first call run. */
     65        static size_t   cbStackMin;
     66        if (!cbStackMin)
    6867        {
    69             cb = atol(psz);
    70             if (!cb)
    71                 cb = 512*1024;
     68            const char *psz = getenv("LIBC_THREAD_MIN_STACK_SIZE");
     69            int cb = 4096;
     70            if (psz)
     71            {
     72                cb = atol(psz);
     73                if (!cb)
     74                    cb = 512*1024;
     75            }
     76            __atomic_xchg((unsigned volatile *)&cbStackMin, cb);
    7277        }
    73         __atomic_xchg((unsigned volatile *)&cbStackMin, cb);
     78
     79        /* adjust it */
     80        if (!cbStack)
     81            cbStack = 512*1024;             /* Default stack size is 512 KB. */
     82        if (cbStack < cbStackMin)
     83            cbStack = cbStackMin;
    7484    }
    75 
    76     /*
    77      * Adjust the stack size.
    78      */
    79     if (!cbStack)
    80         cbStack = 512*1024;             /* Default stack size is 512 KB. */
    81     if (cbStack < cbStackMin)
    82         cbStack = cbStackMin;
    8385
    8486    /*
Note: See TracChangeset for help on using the changeset viewer.