Ignore:
File:
1 edited

Legend:

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

    r8def349 rbd98b58  
    2727}
    2828
    29 extern processor * get_this_processor();
     29/*thread_local*/ extern processor * this_processor;
    3030
    3131//-----------------------------------------------------------------------------
    3232// Forward declarations
    33 forall( dtype T | sized(T) | is_thread(T) )
     33forall(otype T | is_thread(T) )
    3434void start( T* this );
    3535
    36 forall( dtype T | sized(T) | is_thread(T) )
     36forall(otype T | is_thread(T) )
    3737void stop( T* this );
    3838
     
    4242void ?{}(thread_h* this) {
    4343        (&this->c){};
    44         this->c.name = "Anonymous Coroutine";
    4544        (&this->lock){};
    4645        this->next = NULL;
     
    5150}
    5251
    53 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
     52forall(otype T | is_thread(T) )
    5453void ?{}( thread(T)* this ) {
    5554        (&this->handle){};
     
    5756}
    5857
    59 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
     58forall(otype T, ttype P | is_thread(T) | { void ?{}(T*, P); } )
    6059void ?{}( thread(T)* this, P params ) {
    6160        (&this->handle){ params };
     
    6362}
    6463
    65 forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
     64forall(otype T | is_thread(T) )
    6665void ^?{}( thread(T)* this ) {
    6766        stop(&this->handle);
     
    7877extern void thread_schedule( thread_h * );
    7978
    80 forall( dtype T | sized(T) | is_thread(T) )
     79forall(otype T | is_thread(T))
    8180void start( T* this ) {
    8281        coroutine* thrd_c = get_coroutine(this);
    8382        thread_h*  thrd_h = get_thread   (this);
    8483        thrd_c->last = this_coroutine();
    85         get_this_processor()->current_coroutine = thrd_c;
     84        this_processor->current_coroutine = thrd_c;
    8685
    8786        // LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", handle, thrd_c, thrd_h);
     
    9493}
    9594
    96 forall( dtype T | sized(T) | is_thread(T) )
     95forall(otype T | is_thread(T) )
    9796void stop( T* this ) {
    9897        thread_h*  thrd = get_thread(this);
Note: See TracChangeset for help on using the changeset viewer.