Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 2924 → Rev 2925

/branches/tracing/kernel/generic/src/synch/waitq.c
54,7 → 54,7
#include <context.h>
#include <adt/list.h>
 
static void waitq_timeouted_sleep(void *data);
static void waitq_sleep_timed_out(void *data);
 
/** Initialize wait queue
*
71,7 → 71,7
 
/** Handle timeout during waitq_sleep_timeout() call
*
* This routine is called when waitq_sleep_timeout() timeouts.
* This routine is called when waitq_sleep_timeout() times out.
* Interrupts are disabled.
*
* It is supposed to try to remove 'its' thread from the wait queue;
81,7 → 81,7
*
* @param data Pointer to the thread that called waitq_sleep_timeout().
*/
void waitq_timeouted_sleep(void *data)
void waitq_sleep_timed_out(void *data)
{
thread_t *t = (thread_t *) data;
waitq_t *wq;
200,11 → 200,12
* If usec is zero and the SYNCH_FLAGS_NON_BLOCKING bit is set in flags, the
* call will immediately return, reporting either success or failure.
*
* @return One of: ESYNCH_WOULD_BLOCK, ESYNCH_TIMEOUT, ESYNCH_INTERRUPTED,
* ESYNCH_OK_ATOMIC, ESYNCH_OK_BLOCKED.
* @return Returns one of ESYNCH_WOULD_BLOCK, ESYNCH_TIMEOUT,
* ESYNCH_INTERRUPTED, ESYNCH_OK_ATOMIC and
* ESYNCH_OK_BLOCKED.
*
* @li ESYNCH_WOULD_BLOCK means that the sleep failed because at the time of the
* call there was no pending wakeup.
* @li ESYNCH_WOULD_BLOCK means that the sleep failed because at the time of
* the call there was no pending wakeup.
*
* @li ESYNCH_TIMEOUT means that the sleep timed out.
*
291,8 → 292,8
/** Internal implementation of waitq_sleep_timeout().
*
* This function implements logic of sleeping in a wait queue.
* This call must be preceeded by a call to waitq_sleep_prepare()
* and followed by a call to waitq_slee_finish().
* This call must be preceded by a call to waitq_sleep_prepare()
* and followed by a call to waitq_sleep_finish().
*
* @param wq See waitq_sleep_timeout().
* @param usec See waitq_sleep_timeout().
355,7 → 356,7
}
THREAD->timeout_pending = true;
timeout_register(&THREAD->sleep_timeout, (uint64_t) usec,
waitq_timeouted_sleep, THREAD);
waitq_sleep_timed_out, THREAD);
}
 
list_append(&THREAD->wq_link, &wq->head);
405,10 → 406,10
* assumes wq->lock is already locked and interrupts are already disabled.
*
* @param wq Pointer to wait queue.
* @param mode If mode is WAKEUP_FIRST, then the longest waiting thread,
* if any, is woken up. If mode is WAKEUP_ALL, then all
* waiting threads, if any, are woken up. If there are no
* waiting threads to be woken up, the missed wakeup is
* @param mode If mode is WAKEUP_FIRST, then the longest waiting
* thread, if any, is woken up. If mode is WAKEUP_ALL, then
* all waiting threads, if any, are woken up. If there are
* no waiting threads to be woken up, the missed wakeup is
* recorded in the wait queue.
*/
void _waitq_wakeup_unsafe(waitq_t *wq, wakeup_mode_t mode)
431,7 → 432,7
* Lock the thread prior to removing it from the wq.
* This is not necessary because of mutual exclusion
* (the link belongs to the wait queue), but because
* of synchronization with waitq_timeouted_sleep()
* of synchronization with waitq_sleep_timed_out()
* and thread_interrupt_sleep().
*
* In order for these two functions to work, the following