Changes in src/libcfa/concurrency/thread.c [afd550c:de6319f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread.c
rafd550c rde6319f 81 81 disable_interrupts(); 82 82 create_stack(&thrd_c->stack, thrd_c->stack.size); 83 kernelTLS.this_coroutine = thrd_c;83 TL_SET( this_coroutine, thrd_c ); 84 84 CtxStart(&this, CtxInvokeThread); 85 85 assert( thrd_c->last->stack.context ); … … 91 91 92 92 extern "C" { 93 // KERNEL ONLY94 93 void __finish_creation(void) { 95 coroutine_desc* thrd_c = kernelTLS.this_coroutine;94 coroutine_desc* thrd_c = TL_GET( this_coroutine ); 96 95 ThreadCtxSwitch( thrd_c, thrd_c->last ); 97 96 } … … 99 98 100 99 void yield( void ) { 101 // Safety note : This could cause some false positives due to preemption 102 verify( TL_GET( preemption_state.enabled ) ); 100 verify( TL_GET( preemption_state ).enabled ); 103 101 BlockInternal( TL_GET( this_thread ) ); 104 // Safety note : This could cause some false positives due to preemption 105 verify( TL_GET( preemption_state.enabled ) ); 102 verify( TL_GET( preemption_state ).enabled ); 106 103 } 107 104 … … 112 109 } 113 110 114 // KERNEL ONLY115 111 void ThreadCtxSwitch(coroutine_desc* src, coroutine_desc* dst) { 116 112 // set state of current coroutine to inactive … … 120 116 // set new coroutine that the processor is executing 121 117 // and context switch to it 122 kernelTLS.this_coroutine = dst;118 TL_SET( this_coroutine, dst ); 123 119 assert( src->stack.context ); 124 120 CtxSwitch( src->stack.context, dst->stack.context ); 125 kernelTLS.this_coroutine = src;121 TL_SET( this_coroutine, src ); 126 122 127 123 // set state of new coroutine to active
Note:
See TracChangeset
for help on using the changeset viewer.