Changeset 349b2cb for src/libcfa/concurrency/thread.c
- Timestamp:
- Mar 22, 2017, 11:28:47 AM (7 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread.c
r597db97 r349b2cb 35 35 void start( T* this ); 36 36 37 forall( dtype T | is_thread(T) )38 void stop( T* this );39 40 37 //----------------------------------------------------------------------------- 41 38 // Thread ctors and dtors … … 44 41 (&this->cor){}; 45 42 this->cor.name = "Anonymous Coroutine"; 46 (&this->terminated){}; 43 this->mon.owner = this; 44 this->mon.recursion = 1; 47 45 this->next = NULL; 48 46 } … … 66 64 forall( dtype T | sized(T) | is_thread(T) ) 67 65 void ^?{}( scoped(T)* this ) { 68 stop(&this->handle);69 66 ^(&this->handle){}; 70 67 } … … 86 83 87 84 ScheduleThread(thrd_h); 88 }89 90 forall( dtype T | is_thread(T) )91 void stop( T* this ) {92 wait( & get_thread(this)->terminated );93 85 } 94 86 … … 116 108 } 117 109 118 // C Helper to signal the termination of a thread_desc119 // Used in invoke.c120 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 128 110 // Local Variables: // 129 111 // mode: c //
Note: See TracChangeset
for help on using the changeset viewer.