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


Ignore:
Timestamp:
2011-07-08T17:01:01Z (14 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc1a727
Parents:
4e36219 (diff), 026793d (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

    r4e36219 rc028b22  
    5555#include <time/clock.h>
    5656#include <time/timeout.h>
     57#include <time/delay.h>
    5758#include <config.h>
    5859#include <arch/interrupt.h>
     
    259260         */
    260261       
    261         list_append(&thread->rq_link, &cpu->rq[i].rq_head);
     262        list_append(&thread->rq_link, &cpu->rq[i].rq);
    262263        cpu->rq[i].n++;
    263264        irq_spinlock_unlock(&(cpu->rq[i].lock), true);
     
    321322        thread->cpu = NULL;
    322323        thread->flags = flags;
     324        thread->nomigrate = 0;
    323325        thread->state = Entering;
    324326       
     
    421423                atomic_inc(&task->lifecount);
    422424       
    423         list_append(&thread->th_link, &task->th_head);
     425        list_append(&thread->th_link, &task->threads);
    424426       
    425427        irq_spinlock_pass(&task->lock, &threads_lock);
     
    481483        /* Not reached */
    482484        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--;
    483502}
    484503
     
    912931}
    913932
     933sysarg_t sys_thread_udelay(uint32_t usec)
     934{
     935        delay(usec);
     936        return 0;
     937}
     938
    914939/** @}
    915940 */
Note: See TracChangeset for help on using the changeset viewer.