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


Ignore:
Timestamp:
2011-06-22T01:34:53Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d7e82c1, cac458f
Parents:
72ec8cc (diff), bf172825 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    r72ec8cc rf1fae414  
    260260         */
    261261       
    262         list_append(&thread->rq_link, &cpu->rq[i].rq_head);
     262        list_append(&thread->rq_link, &cpu->rq[i].rq);
    263263        cpu->rq[i].n++;
    264264        irq_spinlock_unlock(&(cpu->rq[i].lock), true);
     
    322322        thread->cpu = NULL;
    323323        thread->flags = flags;
     324        thread->nomigrate = 0;
    324325        thread->state = Entering;
    325326       
     
    422423                atomic_inc(&task->lifecount);
    423424       
    424         list_append(&thread->th_link, &task->th_head);
     425        list_append(&thread->th_link, &task->threads);
    425426       
    426427        irq_spinlock_pass(&task->lock, &threads_lock);
     
    482483        /* Not reached */
    483484        while (true);
     485}
     486
     487/** Prevent the current thread from being migrated to another processor. */
     488void thread_migration_disable(void)
     489{
     490        ASSERT(THREAD);
     491
     492        THREAD->nomigrate++;
     493}
     494
     495/** Allow the current thread to be migrated to another processor. */
     496void thread_migration_enable(void)
     497{
     498        ASSERT(THREAD);
     499        ASSERT(THREAD->nomigrate > 0);
     500
     501        THREAD->nomigrate--;
    484502}
    485503
Note: See TracChangeset for help on using the changeset viewer.