Changes in uspace/lib/c/generic/fibril_synch.c [9a99aa5:2654afb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril_synch.c
r9a99aa5 r2654afb 629 629 } 630 630 631 /** Delay fibril execution for the specified number of microseconds632 *633 * @param usec Number of microseconds to sleep634 */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 seconds648 *649 * @param sec Number of seconds to sleep650 */651 void fibril_sleep(unsigned int sec)652 {653 /*654 * Sleep in 1000 second steps to support655 * full argument range656 */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 667 631 /** @} 668 632 */
Note:
See TracChangeset
for help on using the changeset viewer.