Changeset 409 for trunk/kernel/libk/spinlock.c
- Timestamp:
- Dec 20, 2017, 4:51:09 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/spinlock.c
r408 r409 37 37 { 38 38 lock->taken = 0; 39 40 #if CONFIG_LOCKS_DEBUG 39 41 lock->owner = NULL; 40 42 list_entry_init( &lock->list ); 43 #endif 44 41 45 } 42 46 … … 66 70 67 71 this->local_locks++; 72 73 #if CONFIG_LOCKS_DEBUG 68 74 lock->owner = this; 69 75 list_add_first( &this->locks_root , &lock->list ); 76 #endif 70 77 71 78 // irq_state must be restored when lock is released … … 79 86 thread_t * this = CURRENT_THREAD;; 80 87 88 #if CONFIG_LOCKS_DEBUG 81 89 lock->owner = NULL; 90 list_unlink( &lock->list ); 91 #endif 92 82 93 lock->taken = 0; 83 94 this->local_locks--; 84 list_unlink( &lock->list );85 95 86 96 // deschedule if pending request … … 121 131 122 132 this->local_locks++; 133 134 #if CONFIG_LOCKS_DEBUG 123 135 lock->owner = this; 124 136 list_add_first( &this->locks_root , &lock->list ); 137 #endif 125 138 126 139 // restore IRQs … … 148 161 { 149 162 this->local_locks++; 163 164 #if CONFIG_LOCKS_DEBUG 150 165 lock->owner = this; 151 166 list_add_first( &this->locks_root , &lock->list ); 167 #endif 168 152 169 hal_restore_irq(mode); 153 170 return 0; … … 160 177 thread_t * this = CURRENT_THREAD; 161 178 179 #if CONFIG_LOCKS_DEBUG 162 180 lock->owner = NULL; 181 list_unlink( &lock->list ); 182 #endif 183 163 184 lock->taken = 0; 164 185 this->local_locks--; 165 list_unlink( &lock->list );166 186 167 187 // deschedule if pending request
Note: See TracChangeset
for help on using the changeset viewer.