Ignore:
Timestamp:
Nov 10, 2018, 2:16:38 PM (6 years ago)
Author:
alain
Message:

Cosmetic: improve debug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/scheduler.c

    r592 r593  
    179179    sched = &core->scheduler;
    180180
    181     // take the lock protecting sheduler state
    182     busylock_acquire( &sched->lock );
    183 
    184     ////// scan user threads to handle both ACK and DELETE requests
     181    /////////////// scan user threads to handle both ACK and DELETE requests
    185182    root = &sched->u_root;
    186183    iter = root->next;
     
    215212            // get thread ltid
    216213            ltid = LTID_FROM_TRDID( thread->trdid);
     214
     215            // take the lock protecting sheduler state
     216            busylock_acquire( &sched->lock );
    217217
    218218            // update scheduler state
     
    236236            }
    237237
     238            // release the lock protecting sheduler state
     239            busylock_release( &sched->lock );
     240
    238241// check th_nr value
    239242assert( (process->th_nr > 0) , "process th_nr cannot be 0\n" );
     
    241244            // remove thread from process th_tbl[]
    242245            process->th_tbl[ltid] = NULL;
    243             hal_atomic_add( &process->th_nr , - 1 );
     246            count = hal_atomic_add( &process->th_nr , - 1 );
    244247 
    245248            // release memory allocated for thread descriptor
    246249            thread_destroy( thread );
     250
     251            hal_fence();
    247252
    248253#if DEBUG_SCHED_HANDLE_SIGNALS
     
    288293            // get thread ltid
    289294            ltid = LTID_FROM_TRDID( thread->trdid);
     295
     296            // take the lock protecting sheduler state
     297            busylock_acquire( &sched->lock );
    290298
    291299            // update scheduler state
     
    309317            }
    310318
     319            // release the lock protecting sheduler state
     320            busylock_release( &sched->lock );
     321
    311322            // get number of threads in local kernel process
    312323            count = process_zero.th_nr;
     
    330341        }
    331342    }
    332 
    333     // release the lock protecting sheduler state
    334     busylock_release( &sched->lock );
    335 
    336343} // end sched_handle_signals()
    337344
Note: See TracChangeset for help on using the changeset viewer.