Changeset 371bd7d in mainline for kernel/generic/src/proc/thread.c


Ignore:
Timestamp:
2010-03-27T09:22:17Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36a75a2
Parents:
cd82bb1 (diff), eaf22d4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rcd82bb1 r371bd7d  
    7676
    7777/** Thread states */
    78 char *thread_states[] = {
     78const char *thread_states[] = {
    7979        "Invalid",
    8080        "Running",
     
    264264
    265265        atomic_inc(&nrdy);
     266        // FIXME: Why is the avg value never read?
    266267        avg = atomic_get(&nrdy) / config.cpu_active;
    267268        atomic_inc(&cpu->nrdy);
     
    288289 */
    289290thread_t *thread_create(void (* func)(void *), void *arg, task_t *task,
    290     int flags, char *name, bool uncounted)
     291    int flags, const char *name, bool uncounted)
    291292{
    292293        thread_t *t;
     
    501502void thread_sleep(uint32_t sec)
    502503{
    503         thread_usleep(sec * 1000000);
     504        /* Sleep in 1000 second steps to support
     505           full argument range */
     506        while (sec > 0) {
     507                uint32_t period = (sec > 1000) ? 1000 : sec;
     508       
     509                thread_usleep(period * 1000000);
     510                sec -= period;
     511        }
    504512}
    505513
     
    575583{
    576584        waitq_t wq;
    577                                  
     585       
    578586        waitq_initialize(&wq);
    579 
     587       
    580588        (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING);
    581589}
     
    812820}
    813821
     822/** Syscall wrapper for sleeping. */
     823unative_t sys_thread_usleep(uint32_t usec)
     824{
     825        thread_usleep(usec);
     826        return 0;
     827}
     828
    814829/** @}
    815830 */
Note: See TracChangeset for help on using the changeset viewer.