Changeset f02436c8 in mainline


Ignore:
Timestamp:
2005-10-02T17:11:12Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63975c6
Parents:
ac4177ca
Message:

Doxygen-style comments for rwlock.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/synch/rwlock.c

    rac4177ca rf02436c8  
    5151 */
    5252 
    53 #include <synch/synch.h>
    5453#include <synch/rwlock.h>
    5554#include <synch/spinlock.h>
    5655#include <synch/mutex.h>
    5756#include <synch/waitq.h>
    58 
     57#include <synch/synch.h>
    5958#include <list.h>
    6059#include <typedefs.h>
     
    7069static void release_spinlock(void *arg);
    7170
     71/** Initialize reader/writer lock
     72 *
     73 * Initialize reader/writer lock.
     74 *
     75 * @param rwl Reader/Writer lock.
     76 */
    7277void rwlock_initialize(rwlock_t *rwl) {
    7378        spinlock_initialize(&rwl->lock);
     
    7681}
    7782
     83/** Acquire reader/writer lock for reading
     84 *
     85 * Acquire reader/writer lock for reading.
     86 * Timeout and willingness to block may be specified.
     87 *
     88 * @param rwl Reader/Writer lock.
     89 * @param usec Timeout in microseconds.
     90 * @param trylock Switches between blocking and non-blocking mode.
     91 *
     92 * For exact description of possible combinations of
     93 * 'usec' and 'trylock', see comment for waitq_sleep_timeout().
     94 *
     95 * @return See comment for waitq_sleep_timeout().
     96 */
    7897int _rwlock_write_lock_timeout(rwlock_t *rwl, __u32 usec, int trylock)
    7998{
     
    116135}
    117136
     137/** Acquire reader/writer lock for writing
     138 *
     139 * Acquire reader/writer lock for writing.
     140 * Timeout and willingness to block may be specified.
     141 *
     142 * @param rwl Reader/Writer lock.
     143 * @param usec Timeout in microseconds.
     144 * @param trylock Switches between blocking and non-blocking mode.
     145 *
     146 * For exact description of possible combinations of
     147 * 'usec' and 'trylock', see comment for waitq_sleep_timeout().
     148 *
     149 * @return See comment for waitq_sleep_timeout().
     150 */
    118151int _rwlock_read_lock_timeout(rwlock_t *rwl, __u32 usec, int trylock)
    119152{
     
    209242}
    210243
     244/** Release reader/writer lock held by writer
     245 *
     246 * Release reader/writer lock held by writer.
     247 * Handoff reader/writer lock ownership directly
     248 * to waiting readers or a writer.
     249 *
     250 * @param rwl Reader/Writer lock.
     251 */
    211252void rwlock_write_unlock(rwlock_t *rwl)
    212253{
     
    221262}
    222263
     264/** Release reader/writer lock held by reader
     265 *
     266 * Release reader/writer lock held by reader.
     267 * Handoff reader/writer lock ownership directly
     268 * to a waiting writer or don't do anything if more
     269 * readers poses the lock.
     270 *
     271 * @param rwl Reader/Writer lock.
     272 */
    223273void rwlock_read_unlock(rwlock_t *rwl)
    224274{
     
    234284
    235285
    236 /*
     286/** Direct handoff
     287 *
     288 * Direct handoff of reader/writer lock ownership
     289 * to waiting readers or a writer.
     290 *
    237291 * Must be called with rwl->lock locked.
    238292 * Must be called with cpu_priority_high'ed.
    239  */
    240 /*
     293 *
     294 * @param rwl Reader/Writer lock.
     295 * @param readers_only See the description below.
     296 *
    241297 * If readers_only is false: (unlock scenario)
    242298 * Let the first sleeper on 'exclusive' mutex in, no matter
     
    306362}
    307363
     364/** Release spinlock callback
     365 *
     366 * This is a callback function invoked from the scheduler.
     367 * The callback is registered in _rwlock_read_lock_timeout().
     368 *
     369 * @param arg Spinlock.
     370 */
    308371void release_spinlock(void *arg)
    309372{
Note: See TracChangeset for help on using the changeset viewer.