Changeset dd655970 in mainline for uspace/libc/generic
- Timestamp:
- 2007-04-06T14:01:46Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 69e9dd2
- Parents:
- 3ce7f082
- Location:
- uspace/libc/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/libc/generic/thread.c
r3ce7f082 rdd655970 161 161 } 162 162 163 /** Detach thread. 164 * 165 * Currently not implemented. 166 * 167 * @param thread TID. 168 */ 169 void thread_detach(int thread) 170 { 171 } 172 173 /** Join thread. 174 * 175 * Currently not implemented. 176 * 177 * @param thread TID. 178 * 179 * @return Thread exit status. 180 */ 181 int thread_join(int thread) 182 { 183 } 184 185 /** Get current thread ID. 186 * 187 * @return Current thread ID. 188 */ 189 int thread_get_id(void) 190 { 191 return __SYSCALL0(SYS_THREAD_GET_ID); 192 } 193 163 194 /** @} 164 195 */ -
uspace/libc/generic/time.c
r3ce7f082 rdd655970 109 109 } 110 110 111 /** Wait unconditionally for specified microseconds */111 /** Wait unconditionally for specified number of microseconds */ 112 112 void usleep(unsigned long usec) 113 113 { 114 114 atomic_t futex = FUTEX_INITIALIZER; 115 115 116 futex_initialize(&futex, 0);116 futex_initialize(&futex, 0); 117 117 futex_down_timeout(&futex, usec, 0); 118 } 119 120 /** Wait unconditionally for specified number of seconds */ 121 unsigned int sleep(unsigned int seconds) 122 { 123 atomic_t futex = FUTEX_INITIALIZER; 124 125 futex_initialize(&futex, 0); 126 127 /* Sleep in 1000 second steps to support 128 full argument range */ 129 while (seconds > 0) { 130 unsigned int period = (seconds > 1000) ? 1000 : seconds; 131 132 futex_down_timeout(&futex, period * 1000000, 0); 133 seconds -= period; 134 } 118 135 } 119 136
Note:
See TracChangeset
for help on using the changeset viewer.
