Changeset dc747e3 in mainline for generic/include/synch/rwlock.h


Ignore:
Timestamp:
2005-12-15T10:27:59Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7dd2561
Parents:
3fc03fd
Message:

Add SPINLOCK_DECLARE and SPINLOCK_INITIALIZE macros.
SPINLOCK_DECLARE is to be used instead of direct spinlock_t declarations
in dynamically allocated structures on which spinlock_initialize() is called after
their creation.
SPINLOCK_INITIALIZE is to be used instead of direct spinlock_t declarations
of global spinlocks. It declares and initializes the spinlock.
Moreover, both macros are empty on UP so that -Wall warnings about unused structures
get supressed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/include/synch/rwlock.h

    r3fc03fd rdc747e3  
    3434#include <synch/mutex.h>
    3535#include <synch/synch.h>
     36#include <synch/spinlock.h>
    3637
    3738enum rwlock_type {
     
    4243
    4344struct rwlock {
    44         spinlock_t lock;
     45        SPINLOCK_DECLARE(lock);
    4546        mutex_t exclusive;      /**< Mutex for writers, readers can bypass it if readers_in is positive. */
    4647        count_t readers_in;     /**< Number of readers in critical section. */
Note: See TracChangeset for help on using the changeset viewer.