Changeset dc747e3 in mainline for generic/include/synch
- Timestamp:
- 2005-12-15T10:27:59Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7dd2561
- Parents:
- 3fc03fd
- Location:
- generic/include/synch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/synch/rwlock.h
r3fc03fd rdc747e3 34 34 #include <synch/mutex.h> 35 35 #include <synch/synch.h> 36 #include <synch/spinlock.h> 36 37 37 38 enum rwlock_type { … … 42 43 43 44 struct rwlock { 44 spinlock_t lock;45 SPINLOCK_DECLARE(lock); 45 46 mutex_t exclusive; /**< Mutex for writers, readers can bypass it if readers_in is positive. */ 46 47 count_t readers_in; /**< Number of readers in critical section. */ -
generic/include/synch/spinlock.h
r3fc03fd rdc747e3 42 42 }; 43 43 44 /* 45 * SPINLOCK_DECLARE is to be used for dynamically allocated spinlocks, 46 * where the lock gets initialized in run time. 47 */ 48 #define SPINLOCK_DECLARE(slname) spinlock_t slname 49 50 /* 51 * SPINLOCK_INITIALIZE is to be used for statically allocated spinlocks. 52 * It declares and initializes the lock. 53 */ 54 #ifdef CONFIG_DEBUG_SPINLOCK 55 #define SPINLOCK_INITIALIZE(slname) \ 56 spinlock_t slname = { \ 57 .name = #slname, \ 58 .val = 0 \ 59 } 60 #else 61 #define SPINLOCK_INITIALIZE(slname) \ 62 spinlock_t slname = { \ 63 .val = 0 \ 64 } 65 #endif 66 44 67 extern void spinlock_initialize(spinlock_t *sl, char *name); 45 68 extern void spinlock_lock(spinlock_t *sl); … … 49 72 #else 50 73 51 struct spinlock { 52 }; 74 /* On UP systems, spinlocks are effectively left out. */ 75 #define SPINLOCK_DECLARE(name) 76 #define SPINLOCK_INITIALIZE(name) 53 77 54 78 #define spinlock_initialize(x,name) -
generic/include/synch/waitq.h
r3fc03fd rdc747e3 46 46 * Must be acquired before T.lock for each T of type thread_t. 47 47 */ 48 spinlock_t lock;48 SPINLOCK_DECLARE(lock); 49 49 50 50 int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */
Note:
See TracChangeset
for help on using the changeset viewer.
