Changes in src/libcfa/concurrency/thread.c [17af7d1:9c31349]
- File:
-
- 1 edited
-
src/libcfa/concurrency/thread.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread.c
r17af7d1 r9c31349 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.