Ignore:
Timestamp:
Oct 10, 2020, 5:27:12 PM (4 years ago)
Author:
alain
Message:

Cosmetic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/rwlock.c

    r629 r666  
    5252#if DEBUG_RWLOCK_TYPE
    5353thread_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",
     54bool_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)));
     59if( cond ) printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
    5860__FUNCTION__, this->process->pid, this->trdid,
    5961lock_type_str[type], local_cxy, lock );
     
    7476
    7577#if DEBUG_RWLOCK_TYPE
    76 uint32_t lock_type = lock->lock.type;
     78uint32_t   lock_type = lock->lock.type;
     79bool_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)));
    7784#endif
    7885
     
    8289
    8390#if DEBUG_RWLOCK_TYPE
    84 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    85     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    86     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     91if( cond )
    8792printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
    8893__FUNCTION__, this->process->pid, this->trdid,
     
    109114
    110115#if DEBUG_RWLOCK_TYPE
    111 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    112     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    113     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     116if( cond )
    114117printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
    115118__FUNCTION__, this->process->pid, this->trdid,
     
    134137
    135138#if DEBUG_RWLOCK_TYPE
    136 uint32_t lock_type = lock->lock.type;
     139uint32_t   lock_type = lock->lock.type;
     140bool_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)));
    137145#endif
    138146
     
    142150
    143151#if DEBUG_RWLOCK_TYPE
    144 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    145     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    146     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     152if( cond )
    147153printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
    148154__FUNCTION__, this->process->pid, this->trdid,
     
    169175
    170176#if DEBUG_RWLOCK_TYPE
    171 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    172     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    173     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     177if( cond )
    174178printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
    175179__FUNCTION__, this->process->pid, this->trdid,
     
    196200#if DEBUG_RWLOCK_TYPE
    197201thread_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 ) )
     202uint32_t   lock_type = lock->lock.type;
     203bool_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
     211if( cond )
    202212printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
    203213__FUNCTION__, this->process->pid, this->trdid,
     
    213223
    214224#if DEBUG_RWLOCK_TYPE
    215 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    216     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    217     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     225if( cond )
    218226printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
    219227__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     
    237245
    238246#if DEBUG_RWLOCK_TYPE
    239 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    240     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    241     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     247if( cond )
    242248printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
    243249__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     
    272278#if DEBUG_RWLOCK_TYPE
    273279thread_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 ) )
     280uint32_t   lock_type = lock->lock.type;
     281bool_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
     289if( cond )
    278290printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
    279291__FUNCTION__, this->process->pid, this->trdid,
     
    288300
    289301#if DEBUG_RWLOCK_TYPE
    290 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    291     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    292     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     302if( cond )
    293303printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
    294304__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     
    311321
    312322#if DEBUG_RWLOCK_TYPE
    313 if( (lock_type      == DEBUG_RWLOCK_TYPE) &&
    314     ((intptr_t)lock == DEBUG_RWLOCK_PTR ) &&
    315     (local_cxy      == DEBUG_RWLOCK_CXY ) )
     323if( cond )
    316324printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
    317325__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
Note: See TracChangeset for help on using the changeset viewer.