Changeset 41bfc64 in mainline for kernel/generic/src/proc/scheduler.c
- Timestamp:
- 2024-01-20T17:24:56Z (14 months ago)
- Branches:
- master
- Children:
- 7364e2d1
- Parents:
- 3d84734
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-20 16:23:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-20 17:24:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
r3d84734 r41bfc64 313 313 assert(atomic_get_unordered(&THREAD->cpu) == CPU); 314 314 315 THREAD->state = Running;315 atomic_set_unordered(&THREAD->state, Running); 316 316 atomic_set_unordered(&THREAD->priority, rq_index); /* Correct rq index */ 317 317 … … 386 386 irq_spinlock_lock(&thread->lock, false); 387 387 388 assert( thread->state== Running);388 assert(atomic_get_unordered(&thread->state) == Running); 389 389 assert(atomic_get_unordered(&thread->cpu) == CPU); 390 390 … … 396 396 } 397 397 398 thread->state = Ready;398 atomic_set_unordered(&thread->state, Ready); 399 399 400 400 irq_spinlock_unlock(&thread->lock, false); … … 409 409 irq_spinlock_lock(&thread->lock, false); 410 410 411 assert( thread->state == Sleeping || thread->state== Entering);411 assert(atomic_get_unordered(&thread->state) == Sleeping || atomic_get_unordered(&thread->state) == Entering); 412 412 413 413 atomic_set_unordered(&thread->priority, 0); 414 thread->state = Ready;414 atomic_set_unordered(&thread->state, Ready); 415 415 416 416 /* Prefer the CPU on which the thread ran last */ … … 471 471 */ 472 472 panic("tid%" PRIu64 ": unexpected state %s.", 473 thread->tid, thread_states[ thread->state]);473 thread->tid, thread_states[out_state]); 474 474 break; 475 475 } … … 501 501 502 502 irq_spinlock_lock(&THREAD->lock, false); 503 THREAD->state = new_state; 503 504 atomic_set_unordered(&THREAD->state, new_state); 504 505 505 506 /* Update thread kernel accounting */ … … 809 810 thread) { 810 811 printf("%" PRIu64 "(%s) ", thread->tid, 811 thread_states[ thread->state]);812 thread_states[atomic_get_unordered(&thread->state)]); 812 813 } 813 814 printf("\n");
Note:
See TracChangeset
for help on using the changeset viewer.