Changeset 582a0b8 in mainline for uspace/lib/c/generic/thread.c
- Timestamp:
- 2017-05-08T19:20:39Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d2c8533
- Parents:
- 73db198
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/thread.c
r73db198 r582a0b8 196 196 } 197 197 198 /** Wait unconditionally for specified number of microseconds 199 * 200 */ 201 int thread_usleep(useconds_t usec) 202 { 203 (void) __SYSCALL1(SYS_THREAD_USLEEP, usec); 204 return 0; 205 } 206 207 /** Wait unconditionally for specified number of seconds 208 * 209 */ 210 unsigned int thread_sleep(unsigned int sec) 211 { 212 /* 213 * Sleep in 1000 second steps to support 214 * full argument range 215 */ 216 217 while (sec > 0) { 218 unsigned int period = (sec > 1000) ? 1000 : sec; 219 220 thread_usleep(period * 1000000); 221 sec -= period; 222 } 223 224 return 0; 225 } 226 198 227 /** @} 199 228 */
Note:
See TracChangeset
for help on using the changeset viewer.