- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/thread.cfa
r121be3e r09f357ec 58 58 void ?{}( scoped(T)& this ) with( this ) { 59 59 handle{}; 60 __thrd_start(handle );60 __thrd_start(handle, main); 61 61 } 62 62 … … 64 64 void ?{}( scoped(T)& this, P params ) with( this ) { 65 65 handle{ params }; 66 __thrd_start(handle );66 __thrd_start(handle, main); 67 67 } 68 68 … … 75 75 // Starting and stopping threads 76 76 forall( dtype T | is_thread(T) ) 77 void __thrd_start( T & this) {77 void __thrd_start( T & this, void (*main_p)(T &) ) { 78 78 thread_desc * this_thrd = get_thread(this); 79 79 thread_desc * curr_thrd = TL_GET( this_thread ); 80 80 81 81 disable_interrupts(); 82 CtxStart(&this, CtxInvokeThread); 82 CtxStart(main_p, get_coroutine(this), this, CtxInvokeThread); 83 83 84 this_thrd->context.[SP, FP] = this_thrd->self_cor.context.[SP, FP]; 84 85 verify( this_thrd->context.SP ); 85 CtxSwitch( &curr_thrd->context, &this_thrd->context );86 // CtxSwitch( &curr_thrd->context, &this_thrd->context ); 86 87 87 88 ScheduleThread(this_thrd); 88 89 enable_interrupts( __cfaabi_dbg_ctx ); 89 }90 91 extern "C" {92 // KERNEL ONLY93 void __finish_creation(thread_desc * this) {94 // set new coroutine that the processor is executing95 // and context switch to it96 verify( kernelTLS.this_thread != this );97 verify( kernelTLS.this_thread->context.SP );98 CtxSwitch( &this->context, &kernelTLS.this_thread->context );99 }100 90 } 101 91
Note: See TracChangeset
for help on using the changeset viewer.