/kernel/trunk/generic/src/synch/rwlock.c |
---|
26,15 → 26,16 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** Reader/Writer locks |
/** |
* @file rwlock.c |
* @brief Reader/Writer locks. |
* |
* A reader/writer lock can be held by multiple readers at a time. |
* Or it can be exclusively held by a sole writer at a time. |
*/ |
/* |
* |
* These locks are not recursive. |
* Neither readers nor writers will suffer starvation. |
* Because technique called direct hand-off is used, neither readers |
* nor writers will suffer starvation. |
* |
* If there is a writer followed by a reader waiting for the rwlock |
* and the writer times out, all leading readers are automatically woken up |
145,7 → 146,7 |
* @param trylock Switches between blocking and non-blocking mode. |
* |
* For exact description of possible combinations of |
* @usec and @trylock, see comment for waitq_sleep_timeout(). |
* usec and trylock, see comment for waitq_sleep_timeout(). |
* |
* @return See comment for waitq_sleep_timeout(). |
*/ |
/kernel/trunk/generic/src/synch/mutex.c |
---|
51,7 → 51,7 |
* @param trylock Switches between blocking and non-blocking mode. |
* |
* For exact description of possible combinations of |
* @usec and @trylock, see comment for waitq_sleep_timeout(). |
* usec and trylock, see comment for waitq_sleep_timeout(). |
* |
* @return See comment for waitq_sleep_timeout(). |
*/ |
/kernel/trunk/generic/src/synch/semaphore.c |
---|
65,7 → 65,7 |
* @param trydown Switches between blocking and non-blocking mode. |
* |
* For exact description of possible combinations of |
* @usec and @trydown, see comment for waitq_sleep_timeout(). |
* usec and trydown, see comment for waitq_sleep_timeout(). |
* |
* @return See comment for waitq_sleep_timeout(). |
*/ |
/kernel/trunk/generic/src/synch/waitq.c |
---|
26,6 → 26,18 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** |
* @file waitq.c |
* @brief Wait queue. |
* |
* Wait queue is the basic synchronization primitive upon all |
* other synchronization primitives build. |
* |
* It allows threads to wait for an event in first-come, first-served |
* fashion. Conditional operation as well as timeouts and interruptions |
* are supported. |
*/ |
#include <synch/waitq.h> |
#include <synch/synch.h> |
#include <synch/spinlock.h> |
160,30 → 172,30 |
* @param usec Timeout in microseconds. |
* @param nonblocking Blocking vs. non-blocking operation mode switch. |
* |
* If @usec is greater than zero, regardless of the value of @nonblocking, |
* If usec is greater than zero, regardless of the value of nonblocking, |
* the call will not return until either timeout or wakeup comes. |
* |
* If @usec is zero and @nonblocking is zero (false), the call |
* If usec is zero and @nonblocking is zero (false), the call |
* will not return until wakeup comes. |
* |
* If @usec is zero and @nonblocking is non-zero (true), the call will |
* If usec is zero and nonblocking is non-zero (true), the call will |
* immediately return, reporting either success or failure. |
* |
* @return Returns one of: ESYNCH_WOULD_BLOCK, ESYNCH_TIMEOUT, |
* ESYNCH_OK_ATOMIC, ESYNCH_OK_BLOCKED. |
* |
* ESYNCH_WOULD_BLOCK means that the sleep failed because at the time |
* @li ESYNCH_WOULD_BLOCK means that the sleep failed because at the time |
* of the call there was no pending wakeup. |
* |
* ESYNCH_TIMEOUT means that the sleep timed out. |
* @li ESYNCH_TIMEOUT means that the sleep timed out. |
* |
* ESYNCH_INTERRUPTED means that somebody interrupted the sleeping thread. |
* @li ESYNCH_INTERRUPTED means that somebody interrupted the sleeping thread. |
* |
* ESYNCH_OK_ATOMIC means that the sleep succeeded and that there was |
* @li ESYNCH_OK_ATOMIC means that the sleep succeeded and that there was |
* a pending wakeup at the time of the call. The caller was not put |
* asleep at all. |
* |
* ESYNCH_OK_BLOCKED means that the sleep succeeded; the full sleep was |
* @li ESYNCH_OK_BLOCKED means that the sleep succeeded; the full sleep was |
* attempted. |
*/ |
int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int nonblocking) |
/kernel/trunk/generic/src/synch/futex.c |
---|
93,7 → 93,7 |
* |
* @param uaddr Userspace address of the futex counter. |
* @param usec If non-zero, number of microseconds this thread is willing to sleep. |
* @param trydown If @usec is zero and trydown is non-zero, conditional operation will be attempted. |
* @param trydown If usec is zero and trydown is non-zero, conditional operation will be attempted. |
* |
* @return One of ESYNCH_TIMEOUT, ESYNCH_OK_ATOMIC and ESYNCH_OK_BLOCKED. See synch.h. |
* If there is no physical mapping for uaddr ENOENT is returned. |
218,7 → 218,7 |
/** Compute hash index into futex hash table. |
* |
* @param key Address where the @key (i.e. physical address of futex counter) is stored. |
* @param key Address where the key (i.e. physical address of futex counter) is stored. |
* |
* @return Index into futex hash table. |
*/ |
231,7 → 231,7 |
* |
* @param key Address where the key (i.e. physical address of futex counter) is stored. |
* |
* @return True if the item matches the @key. False otherwise. |
* @return True if the item matches the key. False otherwise. |
*/ |
bool futex_ht_compare(__native *key, count_t keys, link_t *item) |
{ |
/kernel/trunk/generic/src/synch/condvar.c |
---|
76,7 → 76,7 |
* @param trywait Blocking versus non-blocking operation mode switch. |
* |
* For exact description of possible combinations of |
* @usec and @trywait, see comment for waitq_sleep_timeout(). |
* usec and trywait, see comment for waitq_sleep_timeout(). |
* |
* @return See comment for waitq_sleep_timeout(). |
*/ |