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


Ignore:
Timestamp:
2010-05-02T10:49:19Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9150781
Parents:
278b4a30
Message:

Deploy task_hold() and task_release().

File:
1 edited

Legend:

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

    r278b4a30 r7ed8530  
    11/*
    2  * Copyright (c) 2001-2004 Jakub Jermar
     2 * Copyright (c) 2010 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    409409
    410410        /*
    411          * t is guaranteed to be the very last thread of its task.
    412          * It is safe to destroy the task.
     411         * Drop the reference to the containing task.
    413412         */
    414         if (atomic_predec(&t->task->refcount) == 0)
    415                 task_destroy(t->task);
     413        task_release(t->task);
    416414       
    417415        slab_free(thread_slab, t);
     
    436434        spinlock_lock(&task->lock);
    437435
    438         atomic_inc(&task->refcount);
     436        /* Hold a reference to the task. */
     437        task_hold(task);
    439438
    440439        /* Must not count kbox thread into lifecount */
Note: See TracChangeset for help on using the changeset viewer.