Changeset dfa4be62 in mainline for kernel/generic/src/proc/scheduler.c
- Timestamp:
- 2024-01-21T16:23:19Z (18 months ago)
- Branches:
- master
- Children:
- d23712e
- Parents:
- a3d87b9
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-03-28 17:40:43)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-21 16:23:19)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
ra3d87b9 rdfa4be62 310 310 switch_task(THREAD->task); 311 311 312 irq_spinlock_lock(&THREAD->lock, false);313 312 assert(atomic_get_unordered(&THREAD->cpu) == CPU); 314 313 … … 364 363 /* Save current CPU cycle */ 365 364 THREAD->last_cycle = get_cycle(); 366 367 irq_spinlock_unlock(&THREAD->lock, false);368 365 } 369 366 … … 386 383 static void thread_requeue_preempted(thread_t *thread) 387 384 { 388 irq_spinlock_lock(&thread->lock, false);389 390 385 assert(atomic_get_unordered(&thread->state) == Running); 391 386 assert(atomic_get_unordered(&thread->cpu) == CPU); … … 400 395 atomic_set_unordered(&thread->state, Ready); 401 396 402 irq_spinlock_unlock(&thread->lock, false);403 404 397 add_to_rq(thread, CPU, prio); 405 398 } … … 408 401 { 409 402 ipl_t ipl = interrupts_disable(); 410 411 irq_spinlock_lock(&thread->lock, false);412 403 413 404 assert(atomic_get_unordered(&thread->state) == Sleeping || atomic_get_unordered(&thread->state) == Entering); … … 423 414 atomic_set_unordered(&thread->cpu, CPU); 424 415 } 425 426 irq_spinlock_unlock(&thread->lock, false);427 416 428 417 add_to_rq(thread, cpu, 0); … … 500 489 } 501 490 502 irq_spinlock_lock(&THREAD->lock, false);503 504 491 atomic_set_unordered(&THREAD->state, new_state); 505 492 … … 514 501 */ 515 502 after_thread_ran_arch(); 516 517 irq_spinlock_unlock(&THREAD->lock, false);518 503 519 504 CPU_LOCAL->exiting_state = new_state; … … 650 635 list_foreach_rev(old_rq->rq, rq_link, thread_t, thread) { 651 636 652 irq_spinlock_lock(&thread->lock, false);653 654 637 /* 655 638 * Do not steal CPU-wired threads, threads … … 658 641 * FPU context is still in the CPU. 659 642 */ 660 if (thread->stolen || thread->nomigrate || 661 thread == fpu_owner) { 662 irq_spinlock_unlock(&thread->lock, false); 643 if (thread->stolen || thread->nomigrate || thread == fpu_owner) { 663 644 continue; 664 645 } … … 666 647 thread->stolen = true; 667 648 atomic_set_unordered(&thread->cpu, CPU); 668 669 irq_spinlock_unlock(&thread->lock, false);670 649 671 650 /*
Note:
See TracChangeset
for help on using the changeset viewer.