Changeset 80649a91 in mainline for libc/generic/thread.c


Ignore:
Timestamp:
2006-05-21T19:28:37Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a410beb
Parents:
1ee11f4
Message:

Merged libadt into libc.
Made lot of psthread and thread stuff thread-safe.
Added new driver framework for easy C connection programming.
Changed FB code to use new API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/thread.c

    r1ee11f4 r80649a91  
    3434#include <psthread.h>
    3535#include <string.h>
     36#include <async.h>
    3637
    3738#include <stdio.h>
     
    8182 *
    8283 * @param uarg Pointer to userspace argument structure.
     84 *
     85 * TODO: Thread stack pages memory leak
    8386 */
    8487void __thread_main(uspace_arg_t *uarg)
    8588{
    86         tcb_t *tcb;
    87         /* This should initialize the area according to TLS specicification */
    88         tcb = __make_tls();
    89         __tcb_set(tcb);
    90         psthread_setup(tcb);
     89        psthread_data_t *pt;
     90
     91        pt = psthread_setup();
     92        __tcb_set(pt->tcb);
     93       
     94        async_create_manager();
    9195
    9296        uarg->uspace_thread_function(uarg->uspace_thread_arg);
     
    9498        free(uarg);
    9599
    96         psthread_teardown(tcb->pst_data);
    97         __free_tls(tcb);
     100        async_destroy_manager();
     101        psthread_teardown(pt);
    98102
    99103        thread_exit(0);
Note: See TracChangeset for help on using the changeset viewer.