Changeset 4687a26c in mainline for uspace/lib/c/include/fibril_synch.h


Ignore:
Timestamp:
2010-11-02T18:29:01Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f35b9ff
Parents:
76e1121f (diff), 28f4adb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/fibril_synch.h

    r76e1121f r4687a26c  
    4343
    4444typedef struct {
     45        fibril_owner_info_t oi;         /* Keep this the first thing. */
    4546        int counter;
    4647        link_t waiters;
    4748} fibril_mutex_t;
    4849
    49 #define FIBRIL_MUTEX_INITIALIZE(name) \
    50         fibril_mutex_t name = { \
     50#define FIBRIL_MUTEX_INITIALIZER(name) \
     51        { \
     52                .oi = { \
     53                        .owned_by = NULL \
     54                }, \
    5155                .counter = 1, \
    5256                .waiters = { \
     
    5559                } \
    5660        }
     61       
     62#define FIBRIL_MUTEX_INITIALIZE(name) \
     63        fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name)
    5764
    5865typedef struct {
     66        fibril_owner_info_t oi; /* Keep this the first thing. */
    5967        unsigned writers;
    6068        unsigned readers;
     
    6270} fibril_rwlock_t;
    6371
    64 #define FIBRIL_RWLOCK_INITIALIZE(name) \
    65         fibril_rwlock_t name = { \
     72#define FIBRIL_RWLOCK_INITIALIZER(name) \
     73        { \
     74                .oi = { \
     75                        .owned_by = NULL \
     76                }, \
    6677                .readers = 0, \
    6778                .writers = 0, \
     
    7283        }
    7384
     85#define FIBRIL_RWLOCK_INITIALIZE(name) \
     86        fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name)
     87
    7488typedef struct {
    7589        link_t waiters;
    7690} fibril_condvar_t;
    7791
    78 #define FIBRIL_CONDVAR_INITIALIZE(name) \
    79         fibril_condvar_t name = { \
     92#define FIBRIL_CONDVAR_INITIALIZER(name) \
     93        { \
    8094                .waiters = { \
    8195                        .next = &name.waiters, \
     
    8397                } \
    8498        }
     99
     100#define FIBRIL_CONDVAR_INITIALIZE(name) \
     101        fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name)
    85102
    86103extern void fibril_mutex_initialize(fibril_mutex_t *);
Note: See TracChangeset for help on using the changeset viewer.