Changeset 600 for trunk/kernel/libk/rwlock.c
- Timestamp:
- Nov 10, 2018, 5:38:51 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/rwlock.c
r563 r600 68 68 #if DEBUG_RWLOCK 69 69 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 70 { 71 printk("\n[DBG] %s : thread %x in process %x READ BLOCK on rwlock %s [%x,%x]\n", 72 __FUNCTION__, this->trdid, this->process->pid, 73 lock_type_str[lock->lock.type], local_cxy, lock ); 74 } 75 #endif 76 // get pointer on calling thread 77 thread_t * this = CURRENT_THREAD; 78 70 printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x]\n", 71 __FUNCTION__, this->process->pid, this->trdid, 72 lock_type_str[lock->lock.type], local_cxy, lock ); 73 #endif 79 74 // register reader thread in waiting queue 80 75 list_add_last( &lock->rd_root , &this->wait_list ); … … 95 90 #if DEBUG_RWLOCK 96 91 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 97 { 98 printk("\n[DBG] %s : thread %x in process READ ACQUIRE on rwlock %s [%x,%x]\n", 99 __FUNCTION__, this->trdid, this->process->pid, 100 lock_type_str[lock->lock.type], local_cxy, lock ); 101 } 92 printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x]\n", 93 __FUNCTION__, this->process->pid, this->trdid, 94 lock_type_str[lock->lock.type], local_cxy, lock ); 102 95 #endif 103 96 … … 127 120 #if DEBUG_RWLOCK 128 121 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 129 { 130 printk("\n[DBG] %s : thread %x in process WRITE BLOCK on rwlock %s [%x,%x]\n", 131 __FUNCTION__, this->trdid, this->process->pid, 132 lock_type_str[lock->lock.type], local_cxy, lock ); 133 } 134 #endif 135 // get pointer on calling thread 136 thread_t * this = CURRENT_THREAD; 137 122 printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x]\n", 123 __FUNCTION__, this->process->pid, this->trdid, 124 lock_type_str[lock->lock.type], local_cxy, lock ); 125 #endif 138 126 // register writer in waiting queue 139 127 list_add_last( &lock->wr_root , &this->wait_list ); … … 154 142 #if DEBUG_RWLOCK 155 143 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 156 { 157 printk("\n[DBG] %s : thread %x in process WRITE ACQUIRE on rwlock %s [%x,%x]\n", 158 __FUNCTION__, this->trdid, this->process->pid, 159 lock_type_str[lock->lock.type], local_cxy, lock ); 160 } 144 printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x]\n", 145 __FUNCTION__, this->process->pid, this->trdid, 146 lock_type_str[lock->lock.type], local_cxy, lock ); 161 147 #endif 162 148 … … 179 165 180 166 #if DEBUG_RWLOCK 181 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 182 { 183 thread_t * this = CURRENT_THREAD; 184 printk("\n[DBG] %s : thread %x in process READ RELEASE on rwlock %s [%x,%x]\n", 185 __FUNCTION__, this->trdid, this->process->pid, 186 lock_type_str[lock->lock.type], local_cxy, lock ); 187 } 167 thread_t * this = CURRENT_THREAD; 168 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 169 printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x]\n", 170 __FUNCTION__, this->process->pid, this->trdid, 171 lock_type_str[lock->lock.type], local_cxy, lock ); 188 172 #endif 189 173 … … 200 184 #if DEBUG_RWLOCK 201 185 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 202 { 203 thread_t * this = CURRENT_THREAD; 204 printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d" 205 " / rwlock %s [%x,%x]\n", 206 __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid, 207 lock_type_str[lock->lock.type], local_cxy, lock ); 208 } 186 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 187 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, 188 lock_type_str[lock->lock.type], local_cxy, lock ); 209 189 #endif 210 190 … … 226 206 #if DEBUG_RWLOCK 227 207 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 228 { 229 thread_t * this = CURRENT_THREAD; 230 printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d" 231 " / rwlock %s [%x,%x]\n", 232 __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid, 233 lock_type_str[lock->lock.type], local_cxy, lock ); 234 } 208 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 209 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, 210 lock_type_str[lock->lock.type], local_cxy, lock ); 235 211 #endif 236 212 … … 258 234 259 235 #if DEBUG_RWLOCK 260 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 261 { 262 thread_t * this = CURRENT_THREAD; 263 printk("\n[DBG] %s : thread %x in process WRITE RELEASE on rwlock %s [%x,%x]\n", 264 __FUNCTION__, this->trdid, this->process->pid, 265 lock_type_str[lock->lock.type], local_cxy, lock ); 266 } 236 thread_t * this = CURRENT_THREAD; 237 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 238 printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x]\n", 239 __FUNCTION__, this->process->pid, this->trdid, 240 lock_type_str[lock->lock.type], local_cxy, lock ); 267 241 #endif 268 242 … … 278 252 #if DEBUG_RWLOCK 279 253 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 280 { 281 thread_t * this = CURRENT_THREAD; 282 printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d" 283 " / rwlock %s [%x,%x]\n", 284 __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid, 285 lock_type_str[lock->lock.type], local_cxy, lock ); 286 } 254 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 255 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, 256 lock_type_str[lock->lock.type], local_cxy, lock ); 287 257 #endif 288 258 // remove this waiting thread from waiting list … … 303 273 #if DEBUG_RWLOCK 304 274 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() ) 305 { 306 thread_t * this = CURRENT_THREAD; 307 printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d" 308 " / rwlock %s [%x,%x]\n", 309 __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid, 310 lock_type_str[lock->lock.type], local_cxy, lock ); 311 } 275 printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n", 276 __FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid, 277 lock_type_str[lock->lock.type], local_cxy, lock ); 312 278 #endif 313 279 // remove this waiting thread from waiting list
Note: See TracChangeset
for help on using the changeset viewer.