Changeset 666 for trunk/kernel/libk/rwlock.c
- Timestamp:
- Oct 10, 2020, 5:27:12 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/rwlock.c
r629 r666 52 52 #if DEBUG_RWLOCK_TYPE 53 53 thread_t * this = CURRENT_THREAD; 54 if( (type == DEBUG_RWLOCK_TYPE) && 55 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 56 (local_cxy == DEBUG_RWLOCK_CXY ) ) 57 printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n", 54 bool_t cond = (lock_type == DEBUG_RWLOCK_TYPE) && 55 (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 56 (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) || 57 ((DEBUG_RWLOCK_CXY == 0) && 58 (DEBUG_RWLOCK_PTR == 0))); 59 if( cond ) printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n", 58 60 __FUNCTION__, this->process->pid, this->trdid, 59 61 lock_type_str[type], local_cxy, lock ); … … 74 76 75 77 #if DEBUG_RWLOCK_TYPE 76 uint32_t lock_type = lock->lock.type; 78 uint32_t lock_type = lock->lock.type; 79 bool_t cond = (lock_type == DEBUG_RWLOCK_TYPE) && 80 (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 81 (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) || 82 ((DEBUG_RWLOCK_CXY == 0) && 83 (DEBUG_RWLOCK_PTR == 0))); 77 84 #endif 78 85 … … 82 89 83 90 #if DEBUG_RWLOCK_TYPE 84 if( (lock_type == DEBUG_RWLOCK_TYPE) && 85 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 86 (local_cxy == DEBUG_RWLOCK_CXY ) ) 91 if( cond ) 87 92 printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 88 93 __FUNCTION__, this->process->pid, this->trdid, … … 109 114 110 115 #if DEBUG_RWLOCK_TYPE 111 if( (lock_type == DEBUG_RWLOCK_TYPE) && 112 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 113 (local_cxy == DEBUG_RWLOCK_CXY ) ) 116 if( cond ) 114 117 printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n", 115 118 __FUNCTION__, this->process->pid, this->trdid, … … 134 137 135 138 #if DEBUG_RWLOCK_TYPE 136 uint32_t lock_type = lock->lock.type; 139 uint32_t lock_type = lock->lock.type; 140 bool_t cond = (lock_type == DEBUG_RWLOCK_TYPE) && 141 (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 142 (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) || 143 ((DEBUG_RWLOCK_CXY == 0) && 144 (DEBUG_RWLOCK_PTR == 0))); 137 145 #endif 138 146 … … 142 150 143 151 #if DEBUG_RWLOCK_TYPE 144 if( (lock_type == DEBUG_RWLOCK_TYPE) && 145 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 146 (local_cxy == DEBUG_RWLOCK_CXY ) ) 152 if( cond ) 147 153 printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 148 154 __FUNCTION__, this->process->pid, this->trdid, … … 169 175 170 176 #if DEBUG_RWLOCK_TYPE 171 if( (lock_type == DEBUG_RWLOCK_TYPE) && 172 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 173 (local_cxy == DEBUG_RWLOCK_CXY ) ) 177 if( cond ) 174 178 printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n", 175 179 __FUNCTION__, this->process->pid, this->trdid, … … 196 200 #if DEBUG_RWLOCK_TYPE 197 201 thread_t * this = CURRENT_THREAD; 198 uint32_t lock_type = lock->lock.type; 199 if( (lock_type == DEBUG_RWLOCK_TYPE) && 200 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 201 (local_cxy == DEBUG_RWLOCK_CXY ) ) 202 uint32_t lock_type = lock->lock.type; 203 bool_t cond = (lock_type == DEBUG_RWLOCK_TYPE) && 204 (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 205 (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) || 206 ((DEBUG_RWLOCK_CXY == 0) && 207 (DEBUG_RWLOCK_PTR == 0))); 208 #endif 209 210 #if DEBUG_RWLOCK_TYPE 211 if( cond ) 202 212 printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 203 213 __FUNCTION__, this->process->pid, this->trdid, … … 213 223 214 224 #if DEBUG_RWLOCK_TYPE 215 if( (lock_type == DEBUG_RWLOCK_TYPE) && 216 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 217 (local_cxy == DEBUG_RWLOCK_CXY ) ) 225 if( cond ) 218 226 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 219 227 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, … … 237 245 238 246 #if DEBUG_RWLOCK_TYPE 239 if( (lock_type == DEBUG_RWLOCK_TYPE) && 240 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 241 (local_cxy == DEBUG_RWLOCK_CXY ) ) 247 if( cond ) 242 248 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 243 249 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, … … 272 278 #if DEBUG_RWLOCK_TYPE 273 279 thread_t * this = CURRENT_THREAD; 274 uint32_t lock_type = lock->lock.type; 275 if( (lock_type == DEBUG_RWLOCK_TYPE) && 276 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 277 (local_cxy == DEBUG_RWLOCK_CXY ) ) 280 uint32_t lock_type = lock->lock.type; 281 bool_t cond = (lock_type == DEBUG_RWLOCK_TYPE) && 282 (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 283 (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) || 284 ((DEBUG_RWLOCK_CXY == 0) && 285 (DEBUG_RWLOCK_PTR == 0))); 286 #endif 287 288 #if DEBUG_RWLOCK_TYPE 289 if( cond ) 278 290 printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 279 291 __FUNCTION__, this->process->pid, this->trdid, … … 288 300 289 301 #if DEBUG_RWLOCK_TYPE 290 if( (lock_type == DEBUG_RWLOCK_TYPE) && 291 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 292 (local_cxy == DEBUG_RWLOCK_CXY ) ) 302 if( cond ) 293 303 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 294 304 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, … … 311 321 312 322 #if DEBUG_RWLOCK_TYPE 313 if( (lock_type == DEBUG_RWLOCK_TYPE) && 314 ((intptr_t)lock == DEBUG_RWLOCK_PTR ) && 315 (local_cxy == DEBUG_RWLOCK_CXY ) ) 323 if( cond ) 316 324 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 317 325 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
Note: See TracChangeset
for help on using the changeset viewer.