Changeset 593 for trunk/kernel/kern/scheduler.c
- Timestamp:
- Nov 10, 2018, 2:16:38 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/scheduler.c
r592 r593 179 179 sched = &core->scheduler; 180 180 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 185 182 root = &sched->u_root; 186 183 iter = root->next; … … 215 212 // get thread ltid 216 213 ltid = LTID_FROM_TRDID( thread->trdid); 214 215 // take the lock protecting sheduler state 216 busylock_acquire( &sched->lock ); 217 217 218 218 // update scheduler state … … 236 236 } 237 237 238 // release the lock protecting sheduler state 239 busylock_release( &sched->lock ); 240 238 241 // check th_nr value 239 242 assert( (process->th_nr > 0) , "process th_nr cannot be 0\n" ); … … 241 244 // remove thread from process th_tbl[] 242 245 process->th_tbl[ltid] = NULL; 243 hal_atomic_add( &process->th_nr , - 1 );246 count = hal_atomic_add( &process->th_nr , - 1 ); 244 247 245 248 // release memory allocated for thread descriptor 246 249 thread_destroy( thread ); 250 251 hal_fence(); 247 252 248 253 #if DEBUG_SCHED_HANDLE_SIGNALS … … 288 293 // get thread ltid 289 294 ltid = LTID_FROM_TRDID( thread->trdid); 295 296 // take the lock protecting sheduler state 297 busylock_acquire( &sched->lock ); 290 298 291 299 // update scheduler state … … 309 317 } 310 318 319 // release the lock protecting sheduler state 320 busylock_release( &sched->lock ); 321 311 322 // get number of threads in local kernel process 312 323 count = process_zero.th_nr; … … 330 341 } 331 342 } 332 333 // release the lock protecting sheduler state334 busylock_release( &sched->lock );335 336 343 } // end sched_handle_signals() 337 344
Note: See TracChangeset
for help on using the changeset viewer.