Changeset 39026d7c in mainline
- Timestamp:
- 2017-11-29T23:41:05Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 908d634
- Parents:
- f300523
- Location:
- uspace
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/ski-con/ski-con.c
rf300523 r39026d7c 31 31 */ 32 32 33 #include <async.h> 33 34 #include <ddf/driver.h> 34 35 #include <ddf/log.h> … … 149 150 } 150 151 151 fibril_usleep(POLL_INTERVAL);152 async_usleep(POLL_INTERVAL); 152 153 } 153 154 -
uspace/drv/char/sun4v-con/sun4v-con.c
rf300523 r39026d7c 149 149 150 150 while (con->input_buffer->read_ptr == con->input_buffer->write_ptr) 151 fibril_usleep(POLL_INTERVAL);151 async_usleep(POLL_INTERVAL); 152 152 153 153 p = 0; -
uspace/lib/c/generic/async.c
rf300523 r39026d7c 1868 1868 1869 1869 amsg_destroy(msg); 1870 } 1871 1872 /** Delay execution for the specified number of seconds 1873 * 1874 * @param sec Number of seconds to sleep 1875 */ 1876 void async_sleep(unsigned int sec) 1877 { 1878 /* 1879 * Sleep in 1000 second steps to support 1880 * full argument range 1881 */ 1882 1883 while (sec > 0) { 1884 unsigned int period = (sec > 1000) ? 1000 : sec; 1885 1886 async_usleep(period * 1000000); 1887 sec -= period; 1888 } 1870 1889 } 1871 1890 -
uspace/lib/c/generic/fibril_synch.c
rf300523 r39026d7c 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 */ -
uspace/lib/c/generic/irc.c
rf300523 r39026d7c 34 34 35 35 #include <assert.h> 36 #include <async.h> 36 37 #include <errno.h> 37 #include <fibril_synch.h>38 38 #include <ipc/irc.h> 39 39 #include <ipc/services.h> … … 72 72 73 73 // XXX This is just a temporary hack 74 fibril_usleep(500 * 1000);74 async_usleep(500 * 1000); 75 75 } 76 76 -
uspace/lib/c/include/async.h
rf300523 r39026d7c 151 151 152 152 extern void async_usleep(suseconds_t); 153 extern void async_sleep(unsigned int); 154 153 155 extern void async_create_manager(void); 154 156 extern void async_destroy_manager(void); -
uspace/lib/c/include/fibril_synch.h
rf300523 r39026d7c 173 173 extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *); 174 174 extern fibril_timer_state_t fibril_timer_clear_locked(fibril_timer_t *); 175 extern void fibril_usleep(useconds_t);176 extern void fibril_sleep(unsigned int);177 175 178 176 #endif -
uspace/lib/c/test/fibril/timer.c
rf300523 r39026d7c 27 27 */ 28 28 29 #include <async.h> 29 30 #include <fibril_synch.h> 30 31 #include <pcut/pcut.h> … … 77 78 78 79 fibril_timer_set_locked(t, 100 * 1000 * 1000, test_timeout_fn, &cnt); 79 fibril_usleep(1000);80 async_usleep(1000); 80 81 fts = fibril_timer_clear_locked(t); 81 82 PCUT_ASSERT_INT_EQUALS(fts_active, fts); … … 100 101 cnt = 0; 101 102 fibril_timer_set(t, 100 * 1000 * 1000, test_timeout_fn, &cnt); 102 fibril_usleep(1000);103 async_usleep(1000); 103 104 fts = fibril_timer_clear(t); 104 105 PCUT_ASSERT_INT_EQUALS(fts_active, fts); … … 126 127 fibril_mutex_unlock(&lock); 127 128 128 fibril_usleep(1000);129 async_usleep(1000); 129 130 130 131 fibril_mutex_lock(&lock); -
uspace/lib/posix/source/time.c
rf300523 r39026d7c 45 45 #include "posix/assert.h" 46 46 47 #include "libc/ fibril_synch.h"47 #include "libc/async.h" 48 48 #include "libc/malloc.h" 49 49 #include "libc/task.h" … … 314 314 // TODO: interruptible sleep 315 315 if (rqtp->tv_sec != 0) { 316 fibril_sleep(rqtp->tv_sec);316 async_sleep(rqtp->tv_sec); 317 317 } 318 318 if (rqtp->tv_nsec != 0) { 319 fibril_usleep(rqtp->tv_nsec / 1000);319 async_usleep(rqtp->tv_nsec / 1000); 320 320 } 321 321 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.