Changeset 629 for trunk/kernel/libk/rwlock.c
- Timestamp:
- May 17, 2019, 9:27:04 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/rwlock.c
r623 r629 2 2 * rwlock.c - kernel local read/write lock implementation. 3 3 * 4 * Author Alain Greiner (2016,2017,2018 )4 * Author Alain Greiner (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 52 52 #if DEBUG_RWLOCK_TYPE 53 53 thread_t * this = CURRENT_THREAD; 54 if( DEBUG_RWLOCK_TYPE == type ) 54 if( (type == DEBUG_RWLOCK_TYPE) && 55 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 56 (local_cxy == DEBUG_RWLOCK_CXY ) ) 55 57 printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n", 56 58 __FUNCTION__, this->process->pid, this->trdid, … … 80 82 81 83 #if DEBUG_RWLOCK_TYPE 82 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 84 if( (lock_type == DEBUG_RWLOCK_TYPE) && 85 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 86 (local_cxy == DEBUG_RWLOCK_CXY ) ) 83 87 printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 84 88 __FUNCTION__, this->process->pid, this->trdid, … … 105 109 106 110 #if DEBUG_RWLOCK_TYPE 107 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 111 if( (lock_type == DEBUG_RWLOCK_TYPE) && 112 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 113 (local_cxy == DEBUG_RWLOCK_CXY ) ) 108 114 printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n", 109 115 __FUNCTION__, this->process->pid, this->trdid, … … 136 142 137 143 #if DEBUG_RWLOCK_TYPE 138 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 144 if( (lock_type == DEBUG_RWLOCK_TYPE) && 145 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 146 (local_cxy == DEBUG_RWLOCK_CXY ) ) 139 147 printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 140 148 __FUNCTION__, this->process->pid, this->trdid, … … 161 169 162 170 #if DEBUG_RWLOCK_TYPE 163 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 171 if( (lock_type == DEBUG_RWLOCK_TYPE) && 172 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 173 (local_cxy == DEBUG_RWLOCK_CXY ) ) 164 174 printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n", 165 175 __FUNCTION__, this->process->pid, this->trdid, … … 187 197 thread_t * this = CURRENT_THREAD; 188 198 uint32_t lock_type = lock->lock.type; 189 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 199 if( (lock_type == DEBUG_RWLOCK_TYPE) && 200 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 201 (local_cxy == DEBUG_RWLOCK_CXY ) ) 190 202 printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 191 203 __FUNCTION__, this->process->pid, this->trdid, … … 201 213 202 214 #if DEBUG_RWLOCK_TYPE 203 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 215 if( (lock_type == DEBUG_RWLOCK_TYPE) && 216 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 217 (local_cxy == DEBUG_RWLOCK_CXY ) ) 204 218 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 205 219 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, … … 223 237 224 238 #if DEBUG_RWLOCK_TYPE 225 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 239 if( (lock_type == DEBUG_RWLOCK_TYPE) && 240 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 241 (local_cxy == DEBUG_RWLOCK_CXY ) ) 226 242 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 227 243 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, … … 257 273 thread_t * this = CURRENT_THREAD; 258 274 uint32_t lock_type = lock->lock.type; 259 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 275 if( (lock_type == DEBUG_RWLOCK_TYPE) && 276 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 277 (local_cxy == DEBUG_RWLOCK_CXY ) ) 260 278 printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 261 279 __FUNCTION__, this->process->pid, this->trdid, … … 270 288 271 289 #if DEBUG_RWLOCK_TYPE 272 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 290 if( (lock_type == DEBUG_RWLOCK_TYPE) && 291 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 292 (local_cxy == DEBUG_RWLOCK_CXY ) ) 273 293 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 274 294 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, … … 291 311 292 312 #if DEBUG_RWLOCK_TYPE 293 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) ) 313 if( (lock_type == DEBUG_RWLOCK_TYPE) && 314 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 315 (local_cxy == DEBUG_RWLOCK_CXY ) ) 294 316 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 295 317 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
Note: See TracChangeset
for help on using the changeset viewer.