Changeset 63e27ef in mainline for kernel/generic/src/proc/thread.c
- Timestamp:
- 2017-06-19T21:47:42Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- deacc58d
- Parents:
- 7354b5e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
r7354b5e r63e27ef 36 36 */ 37 37 38 #include <assert.h> 38 39 #include <proc/scheduler.h> 39 40 #include <proc/thread.h> … … 64 65 #include <print.h> 65 66 #include <mm/slab.h> 66 #include <debug.h>67 67 #include <main/uinit.h> 68 68 #include <syscall/copy.h> … … 268 268 static void before_thread_is_ready(thread_t *thread) 269 269 { 270 ASSERT(irq_spinlock_locked(&thread->lock));270 assert(irq_spinlock_locked(&thread->lock)); 271 271 workq_before_thread_is_ready(thread); 272 272 } … … 283 283 irq_spinlock_lock(&thread->lock, true); 284 284 285 ASSERT(thread->state != Ready);285 assert(thread->state != Ready); 286 286 287 287 before_thread_is_ready(thread); … … 293 293 if (thread->wired || thread->nomigrate || thread->fpu_context_engaged) { 294 294 /* Cannot ready to another CPU */ 295 ASSERT(thread->cpu != NULL);295 assert(thread->cpu != NULL); 296 296 cpu = thread->cpu; 297 297 } else if (thread->stolen) { … … 300 300 } else if (thread->cpu) { 301 301 /* Prefer the CPU on which the thread ran last */ 302 ASSERT(thread->cpu != NULL);302 assert(thread->cpu != NULL); 303 303 cpu = thread->cpu; 304 304 } else { … … 431 431 void thread_destroy(thread_t *thread, bool irq_res) 432 432 { 433 ASSERT(irq_spinlock_locked(&thread->lock));434 ASSERT((thread->state == Exiting) || (thread->state == Lingering));435 ASSERT(thread->task);436 ASSERT(thread->cpu);433 assert(irq_spinlock_locked(&thread->lock)); 434 assert((thread->state == Exiting) || (thread->state == Lingering)); 435 assert(thread->task); 436 assert(thread->cpu); 437 437 438 438 irq_spinlock_lock(&thread->cpu->lock, false); … … 561 561 void thread_interrupt(thread_t *thread) 562 562 { 563 ASSERT(thread != NULL);563 assert(thread != NULL); 564 564 565 565 irq_spinlock_lock(&thread->lock, true); … … 582 582 bool thread_interrupted(thread_t *thread) 583 583 { 584 ASSERT(thread != NULL);584 assert(thread != NULL); 585 585 586 586 bool interrupted; … … 596 596 void thread_migration_disable(void) 597 597 { 598 ASSERT(THREAD);598 assert(THREAD); 599 599 600 600 THREAD->nomigrate++; … … 604 604 void thread_migration_enable(void) 605 605 { 606 ASSERT(THREAD);607 ASSERT(THREAD->nomigrate > 0);606 assert(THREAD); 607 assert(THREAD->nomigrate > 0); 608 608 609 609 if (THREAD->nomigrate > 0) … … 650 650 651 651 irq_spinlock_lock(&thread->lock, true); 652 ASSERT(!thread->detached);652 assert(!thread->detached); 653 653 irq_spinlock_unlock(&thread->lock, true); 654 654 … … 671 671 */ 672 672 irq_spinlock_lock(&thread->lock, true); 673 ASSERT(!thread->detached);673 assert(!thread->detached); 674 674 675 675 if (thread->state == Lingering) { … … 809 809 bool thread_exists(thread_t *thread) 810 810 { 811 ASSERT(interrupts_disabled());812 ASSERT(irq_spinlock_locked(&threads_lock));811 assert(interrupts_disabled()); 812 assert(irq_spinlock_locked(&threads_lock)); 813 813 814 814 avltree_node_t *node = … … 830 830 uint64_t time = get_cycle(); 831 831 832 ASSERT(interrupts_disabled());833 ASSERT(irq_spinlock_locked(&THREAD->lock));832 assert(interrupts_disabled()); 833 assert(irq_spinlock_locked(&THREAD->lock)); 834 834 835 835 if (user) … … 867 867 thread_t *thread_find_by_id(thread_id_t thread_id) 868 868 { 869 ASSERT(interrupts_disabled());870 ASSERT(irq_spinlock_locked(&threads_lock));869 assert(interrupts_disabled()); 870 assert(irq_spinlock_locked(&threads_lock)); 871 871 872 872 thread_iterator_t iterator;
Note:
See TracChangeset
for help on using the changeset viewer.