Changeset 132ab5d1 in mainline for uspace/lib/c/generic/fibril_synch.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (7 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (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 commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/fibril_synch.c

    r8bfb163 r132ab5d1  
    629629}
    630630
    631 /** Delay fibril execution for the specified number of microseconds
    632  *
    633  * @param usec Number of microseconds to sleep
    634  */
    635 void fibril_usleep(useconds_t usec)
    636 {
    637         fibril_condvar_t cv;
    638         fibril_mutex_t lock;
    639 
    640         fibril_condvar_initialize(&cv);
    641         fibril_mutex_initialize(&lock);
    642         fibril_mutex_lock(&lock);
    643         fibril_condvar_wait_timeout(&cv, &lock, usec);
    644         fibril_mutex_unlock(&lock);
    645 }
    646 
    647 /** Delay fibril execution for the specified number of seconds
    648  *
    649  * @param sec Number of seconds to sleep
    650  */
    651 void fibril_sleep(unsigned int sec)
    652 {
    653         /*
    654          * Sleep in 1000 second steps to support
    655          * full argument range
    656          */
    657 
    658         while (sec > 0) {
    659                 unsigned int period = (sec > 1000) ? 1000 : sec;
    660 
    661                 fibril_usleep(period * 1000000);
    662                 sec -= period;
    663         }
    664 }
    665 
    666 
    667631/** @}
    668632 */
Note: See TracChangeset for help on using the changeset viewer.