Ignore:
Timestamp:
2007-05-31T21:25:54Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7f043c0
Parents:
e8a0b90
Message:

Fix the problem with sys_thread_create() by splitting the create and attach functionality of
thread_create(). Now it is possible to specify a flag that will cause thread_create() to only allocate and
initialize the thread structure. A call to thread_attach() will make the thread visible to the system.
This arrangement makes it easier to undo creation of a thread in case of a failure in sys_thread_create().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/thread.h

    re8a0b90 rd8431986  
    6464/** Thread executes in userspace. */
    6565#define THREAD_FLAG_USPACE      (1 << 2)
     66/** Thread will be attached by the caller. */
     67#define THREAD_FLAG_NOATTACH    (1 << 3)
    6668
    6769/** Thread states. */
     
    221223extern thread_t *thread_create(void (* func)(void *), void *arg, task_t *task,
    222224    int flags, char *name, bool uncounted);
     225extern void thread_attach(thread_t *t, task_t *task);
    223226extern void thread_ready(thread_t *t);
    224227extern void thread_exit(void) __attribute__((noreturn));
Note: See TracChangeset for help on using the changeset viewer.