Changes in kernel/generic/src/proc/thread.c [e7c4115d:8ad7dd1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
re7c4115d r8ad7dd1 36 36 */ 37 37 38 #include <assert.h>39 38 #include <proc/scheduler.h> 40 39 #include <proc/thread.h> … … 62 61 #include <arch/faddr.h> 63 62 #include <atomic.h> 64 #include <mem .h>63 #include <memstr.h> 65 64 #include <print.h> 66 65 #include <mm/slab.h> 66 #include <debug.h> 67 67 #include <main/uinit.h> 68 68 #include <syscall/copy.h> … … 228 228 #endif 229 229 230 return STACK_FRAMES; /* number of framesfreed */230 return 1; /* One page freed */ 231 231 } 232 232 … … 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.