Ignore:
File:
1 edited

Legend:

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

    r63f8966 r7f122e3  
    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.