Changeset 4913:5640b4c00ace in roaraudio for libroar/libroar.c
- Timestamp:
- 05/07/11 20:10:37 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/libroar.c
r4896 r4913 97 97 } 98 98 99 voidroar_usleep(uint_least32_t t) {99 int roar_usleep(uint_least32_t t) { 100 100 #ifdef ROAR_TARGET_WIN32 101 101 Sleep(t/(uint_least32_t)1000); 102 return 0; 102 103 #elif defined(ROAR_HAVE_NANOSLEEP) 103 104 struct timespec tv; … … 115 116 while (nanosleep(&tv, &left) == -1) 116 117 memcpy(&tv, &left, sizeof(tv)); 118 return 0; 117 119 #elif defined(ROAR_HAVE_USLEEP) 118 120 usleep(t); 121 return 0; 119 122 #else 120 123 ROAR_ERR("roar_usleep(t=%llu): can not sleep: not implemented", (long long unsigned int)t); 121 124 roar_strap(ROAR_TRAP_GROUP_LIBROAR, "usleep.not-implemented"); 122 125 roar_err_set(ROAR_ERROR_NOSYS); 126 return -1; 123 127 #endif 124 128 } 125 129 130 int roar_sleep(int t) { 131 if ( t < 0 ) { 132 roar_err_set(ROAR_ERROR_CAUSALITY); 133 return -1; 134 } 135 136 while (t) 137 t = sleep(t); 138 139 return 0; 140 } 141 126 142 //ll
Note: See TracChangeset
for help on using the changeset viewer.