Changeset 3b3e776 in mainline for kernel/generic/src/proc/thread.c


Ignore:
Timestamp:
2010-02-05T10:57:50Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0358da0
Parents:
3f085132 (diff), b4cbef1 (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:

merged with head

File:
1 edited

Legend:

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

    r3f085132 r3b3e776  
    501501void thread_sleep(uint32_t sec)
    502502{
    503         thread_usleep(sec * 1000000);
     503        /* Sleep in 1000 second steps to support
     504           full argument range */
     505        while (sec > 0) {
     506                uint32_t period = (sec > 1000) ? 1000 : sec;
     507       
     508                thread_usleep(period * 1000000);
     509                sec -= period;
     510        }
    504511}
    505512
     
    575582{
    576583        waitq_t wq;
    577                                  
     584       
    578585        waitq_initialize(&wq);
    579 
     586       
    580587        (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING);
    581588}
     
    812819}
    813820
     821/** Syscall wrapper for sleeping. */
     822unative_t sys_thread_usleep(uint32_t usec)
     823{
     824        thread_usleep(usec);
     825        return 0;
     826}
     827
    814828/** @}
    815829 */
Note: See TracChangeset for help on using the changeset viewer.