Ignore:
Timestamp:
Mar 22, 2017, 11:28:47 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
9c14ae9
Parents:
597db97 (diff), a53e10a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r597db97 r349b2cb  
    3535void start( T* this );
    3636
    37 forall( dtype T | is_thread(T) )
    38 void stop( T* this );
    39 
    4037//-----------------------------------------------------------------------------
    4138// Thread ctors and dtors
     
    4441        (&this->cor){};
    4542        this->cor.name = "Anonymous Coroutine";
    46         (&this->terminated){};
     43        this->mon.owner = this;
     44        this->mon.recursion = 1;
    4745        this->next = NULL;
    4846}
     
    6664forall( dtype T | sized(T) | is_thread(T) )
    6765void ^?{}( scoped(T)* this ) {
    68         stop(&this->handle);
    6966        ^(&this->handle){};
    7067}
     
    8683
    8784        ScheduleThread(thrd_h);
    88 }
    89 
    90 forall( dtype T | is_thread(T) )
    91 void stop( T* this ) {
    92         wait( & get_thread(this)->terminated );
    9385}
    9486
     
    116108}
    117109
    118 // C Helper to signal the termination of a thread_desc
    119 // Used in invoke.c
    120 extern "C" {
    121         void __thread_signal_termination( thread_desc * this ) {
    122                 this->cor.state = Halted;
    123                 LIB_DEBUG_PRINTF("Thread end : %p\n", this);
    124                 signal( &this->terminated );   
    125         }
    126 }
    127 
    128110// Local Variables: //
    129111// mode: c //
Note: See TracChangeset for help on using the changeset viewer.