Changeset 63e27ef in mainline for kernel/generic/src/proc/thread.c


Ignore:
Timestamp:
2017-06-19T21:47:42Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
deacc58d
Parents:
7354b5e
Message:

ASSERT → assert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/thread.c

    r7354b5e r63e27ef  
    3636 */
    3737
     38#include <assert.h>
    3839#include <proc/scheduler.h>
    3940#include <proc/thread.h>
     
    6465#include <print.h>
    6566#include <mm/slab.h>
    66 #include <debug.h>
    6767#include <main/uinit.h>
    6868#include <syscall/copy.h>
     
    268268static void before_thread_is_ready(thread_t *thread)
    269269{
    270         ASSERT(irq_spinlock_locked(&thread->lock));
     270        assert(irq_spinlock_locked(&thread->lock));
    271271        workq_before_thread_is_ready(thread);
    272272}
     
    283283        irq_spinlock_lock(&thread->lock, true);
    284284       
    285         ASSERT(thread->state != Ready);
     285        assert(thread->state != Ready);
    286286
    287287        before_thread_is_ready(thread);
     
    293293        if (thread->wired || thread->nomigrate || thread->fpu_context_engaged) {
    294294                /* Cannot ready to another CPU */
    295                 ASSERT(thread->cpu != NULL);
     295                assert(thread->cpu != NULL);
    296296                cpu = thread->cpu;
    297297        } else if (thread->stolen) {
     
    300300        } else if (thread->cpu) {
    301301                /* Prefer the CPU on which the thread ran last */
    302                 ASSERT(thread->cpu != NULL);
     302                assert(thread->cpu != NULL);
    303303                cpu = thread->cpu;
    304304        } else {
     
    431431void thread_destroy(thread_t *thread, bool irq_res)
    432432{
    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);
    437437       
    438438        irq_spinlock_lock(&thread->cpu->lock, false);
     
    561561void thread_interrupt(thread_t *thread)
    562562{
    563         ASSERT(thread != NULL);
     563        assert(thread != NULL);
    564564       
    565565        irq_spinlock_lock(&thread->lock, true);
     
    582582bool thread_interrupted(thread_t *thread)
    583583{
    584         ASSERT(thread != NULL);
     584        assert(thread != NULL);
    585585       
    586586        bool interrupted;
     
    596596void thread_migration_disable(void)
    597597{
    598         ASSERT(THREAD);
     598        assert(THREAD);
    599599       
    600600        THREAD->nomigrate++;
     
    604604void thread_migration_enable(void)
    605605{
    606         ASSERT(THREAD);
    607         ASSERT(THREAD->nomigrate > 0);
     606        assert(THREAD);
     607        assert(THREAD->nomigrate > 0);
    608608       
    609609        if (THREAD->nomigrate > 0)
     
    650650       
    651651        irq_spinlock_lock(&thread->lock, true);
    652         ASSERT(!thread->detached);
     652        assert(!thread->detached);
    653653        irq_spinlock_unlock(&thread->lock, true);
    654654       
     
    671671         */
    672672        irq_spinlock_lock(&thread->lock, true);
    673         ASSERT(!thread->detached);
     673        assert(!thread->detached);
    674674       
    675675        if (thread->state == Lingering) {
     
    809809bool thread_exists(thread_t *thread)
    810810{
    811         ASSERT(interrupts_disabled());
    812         ASSERT(irq_spinlock_locked(&threads_lock));
     811        assert(interrupts_disabled());
     812        assert(irq_spinlock_locked(&threads_lock));
    813813
    814814        avltree_node_t *node =
     
    830830        uint64_t time = get_cycle();
    831831
    832         ASSERT(interrupts_disabled());
    833         ASSERT(irq_spinlock_locked(&THREAD->lock));
     832        assert(interrupts_disabled());
     833        assert(irq_spinlock_locked(&THREAD->lock));
    834834       
    835835        if (user)
     
    867867thread_t *thread_find_by_id(thread_id_t thread_id)
    868868{
    869         ASSERT(interrupts_disabled());
    870         ASSERT(irq_spinlock_locked(&threads_lock));
     869        assert(interrupts_disabled());
     870        assert(irq_spinlock_locked(&threads_lock));
    871871       
    872872        thread_iterator_t iterator;
Note: See TracChangeset for help on using the changeset viewer.