Changeset 89c57b6 in mainline for uspace/lib/c/include/fibril_synch.h
- Timestamp:
- 2011-04-13T14:45:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88634420
- Parents:
- cefb126 (diff), 17279ead (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/fibril_synch.h
rcefb126 r89c57b6 43 43 44 44 typedef struct { 45 fibril_owner_info_t oi; /* Keep this the first thing. */ 45 46 int counter; 46 47 link_t waiters; 47 48 } fibril_mutex_t; 48 49 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 }, \ 51 55 .counter = 1, \ 52 56 .waiters = { \ … … 55 59 } \ 56 60 } 61 62 #define FIBRIL_MUTEX_INITIALIZE(name) \ 63 fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name) 57 64 58 65 typedef struct { 66 fibril_owner_info_t oi; /* Keep this the first thing. */ 59 67 unsigned writers; 60 68 unsigned readers; … … 62 70 } fibril_rwlock_t; 63 71 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 }, \ 66 77 .readers = 0, \ 67 78 .writers = 0, \ … … 72 83 } 73 84 85 #define FIBRIL_RWLOCK_INITIALIZE(name) \ 86 fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name) 87 74 88 typedef struct { 75 89 link_t waiters; 76 90 } fibril_condvar_t; 77 91 78 #define FIBRIL_CONDVAR_INITIALIZE (name) \79 fibril_condvar_t name ={ \92 #define FIBRIL_CONDVAR_INITIALIZER(name) \ 93 { \ 80 94 .waiters = { \ 81 95 .next = &name.waiters, \ … … 84 98 } 85 99 100 #define FIBRIL_CONDVAR_INITIALIZE(name) \ 101 fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name) 102 86 103 extern void fibril_mutex_initialize(fibril_mutex_t *); 87 104 extern void fibril_mutex_lock(fibril_mutex_t *); 88 105 extern bool fibril_mutex_trylock(fibril_mutex_t *); 89 106 extern void fibril_mutex_unlock(fibril_mutex_t *); 107 extern bool fibril_mutex_is_locked(fibril_mutex_t *); 90 108 91 109 extern void fibril_rwlock_initialize(fibril_rwlock_t *); … … 94 112 extern void fibril_rwlock_read_unlock(fibril_rwlock_t *); 95 113 extern void fibril_rwlock_write_unlock(fibril_rwlock_t *); 114 extern bool fibril_rwlock_is_read_locked(fibril_rwlock_t *); 115 extern bool fibril_rwlock_is_write_locked(fibril_rwlock_t *); 116 extern bool fibril_rwlock_is_locked(fibril_rwlock_t *); 96 117 97 118 extern void fibril_condvar_initialize(fibril_condvar_t *);
Note:
See TracChangeset
for help on using the changeset viewer.