Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2187 → Rev 2188

/trunk/uspace/libc/generic/time.c
108,14 → 108,31
return 0;
}
 
/** Wait unconditionally for specified microseconds */
/** Wait unconditionally for specified number of microseconds */
void usleep(unsigned long usec)
{
atomic_t futex = FUTEX_INITIALIZER;
 
futex_initialize(&futex,0);
futex_initialize(&futex, 0);
futex_down_timeout(&futex, usec, 0);
}
 
/** Wait unconditionally for specified number of seconds */
unsigned int sleep(unsigned int seconds)
{
atomic_t futex = FUTEX_INITIALIZER;
 
futex_initialize(&futex, 0);
/* Sleep in 1000 second steps to support
full argument range */
while (seconds > 0) {
unsigned int period = (seconds > 1000) ? 1000 : seconds;
futex_down_timeout(&futex, period * 1000000, 0);
seconds -= period;
}
}
 
/** @}
*/
/trunk/uspace/libc/generic/thread.c
160,5 → 160,36
__SYSCALL1(SYS_THREAD_EXIT, (sysarg_t) status);
}
 
/** Detach thread.
*
* Currently not implemented.
*
* @param thread TID.
*/
void thread_detach(int thread)
{
}
 
/** Join thread.
*
* Currently not implemented.
*
* @param thread TID.
*
* @return Thread exit status.
*/
int thread_join(int thread)
{
}
 
/** Get current thread ID.
*
* @return Current thread ID.
*/
int thread_get_id(void)
{
return __SYSCALL0(SYS_THREAD_GET_ID);
}
 
/** @}
*/