Changeset 2a46e10 in mainline for generic/src/proc/thread.c


Ignore:
Timestamp:
2006-02-16T13:35:02Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3debedec
Parents:
ff4e1cd
Message:

Avoid memory exhaustion in thread_create in slab2 test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/proc/thread.c

    rff4e1cd r2a46e10  
    9696        thread_t *t = (thread_t *)obj;
    9797        pfn_t pfn;
     98        int status;
    9899
    99100        spinlock_initialize(&t->lock, "thread_t_lock");
     
    103104        link_initialize(&t->threads_link);
    104105       
    105         pfn = frame_alloc(ONE_FRAME, FRAME_KA | kmflags);
     106        pfn = frame_alloc_rc(ONE_FRAME, FRAME_KA | kmflags,&status);
     107        if (status)
     108                return -1;
    106109        t->kstack = (__u8 *)PA2KA(PFN2ADDR(pfn));
    107         if (!t->kstack)
    108                 return -1;
    109110
    110111        return 0;
     
    230231       
    231232        t = (thread_t *) slab_alloc(thread_slab, 0);
     233        if (!t)
     234                return NULL;
    232235       
    233236        /* Not needed, but good for debugging */
Note: See TracChangeset for help on using the changeset viewer.