Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/threads.c

    rbd98b58 r8def349  
    2727}
    2828
    29 /*thread_local*/ extern processor * this_processor;
     29extern processor * get_this_processor();
    3030
    3131//-----------------------------------------------------------------------------
    3232// Forward declarations
    33 forall(otype T | is_thread(T) )
     33forall( dtype T | sized(T) | is_thread(T) )
    3434void start( T* this );
    3535
    36 forall(otype T | is_thread(T) )
     36forall( dtype T | sized(T) | is_thread(T) )
    3737void stop( T* this );
    3838
     
    4242void ?{}(thread_h* this) {
    4343        (&this->c){};
     44        this->c.name = "Anonymous Coroutine";
    4445        (&this->lock){};
    4546        this->next = NULL;
     
    5051}
    5152
    52 forall(otype T | is_thread(T) )
     53forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
    5354void ?{}( thread(T)* this ) {
    5455        (&this->handle){};
     
    5657}
    5758
    58 forall(otype T, ttype P | is_thread(T) | { void ?{}(T*, P); } )
     59forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
    5960void ?{}( thread(T)* this, P params ) {
    6061        (&this->handle){ params };
     
    6263}
    6364
    64 forall(otype T | is_thread(T) )
     65forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
    6566void ^?{}( thread(T)* this ) {
    6667        stop(&this->handle);
     
    7778extern void thread_schedule( thread_h * );
    7879
    79 forall(otype T | is_thread(T))
     80forall( dtype T | sized(T) | is_thread(T) )
    8081void start( T* this ) {
    8182        coroutine* thrd_c = get_coroutine(this);
    8283        thread_h*  thrd_h = get_thread   (this);
    8384        thrd_c->last = this_coroutine();
    84         this_processor->current_coroutine = thrd_c;
     85        get_this_processor()->current_coroutine = thrd_c;
    8586
    8687        // LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", handle, thrd_c, thrd_h);
     
    9394}
    9495
    95 forall(otype T | is_thread(T) )
     96forall( dtype T | sized(T) | is_thread(T) )
    9697void stop( T* this ) {
    9798        thread_h*  thrd = get_thread(this);
Note: See TracChangeset for help on using the changeset viewer.