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


Ignore:
Timestamp:
2011-06-13T18:53:42Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9934f7d
Parents:
e8a69913
Message:

More lightweight implementation of delay() in kernel.

File:
1 edited

Legend:

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

    re8a69913 r43ac0cc  
    322322        thread->cpu = NULL;
    323323        thread->flags = flags;
     324        thread->nomigrate = 0;
    324325        thread->state = Entering;
    325326       
     
    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.