Changeset 409 for trunk/kernel/libk/rwlock.c
- Timestamp:
- Dec 20, 2017, 4:51:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/rwlock.c
r337 r409 37 37 lock->current = 0; 38 38 lock->count = 0; 39 40 #if CONFIG_LOCKS_DEBUG 39 41 lock->owner = NULL; 42 list_entry_init( &lock->list ); 43 #endif 44 40 45 } 41 46 … … 65 70 this->local_locks++; 66 71 72 #if CONFIG_LOCKS_DEBUG 73 list_add_first( &this->locks_root , &lock->list ); 74 #endif 75 67 76 // consistency 68 77 hal_fence(); … … 88 97 hal_atomic_add( &lock->count , -1 ); 89 98 this->local_locks--; 99 100 #if CONFIG_LOCKS_DEBUG 101 list_unlink( &lock->list ); 102 #endif 90 103 91 104 // enable IRQs … … 123 136 } 124 137 138 this->local_locks++; 139 140 #if CONFIG_LOCKS_DEBUG 125 141 lock->owner = this; 126 this->local_locks++; 142 list_add_first( &this->locks_root , &lock->list ); 143 #endif 127 144 128 145 // enable IRQs … … 140 157 hal_disable_irq( &mode ); 141 158 159 #if CONFIG_LOCKS_DEBUG 160 lock->owner = NULL; 161 list_unlink( &lock->list ); 162 #endif 163 142 164 // release lock 143 165 lock->current++; 144 lock->owner = NULL;145 166 this->local_locks--; 146 167
Note: See TracChangeset
for help on using the changeset viewer.