- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.hfa
r8fc9a5f rbe73f30 63 63 void prime(T & cor); 64 64 65 static inline struct $coroutine * active_coroutine() { return TL_GET( this_thread)->curr_cor; }65 static inline struct $coroutine * active_coroutine() { return active_thread()->curr_cor; } 66 66 67 67 //----------------------------------------------------------------------------- … … 87 87 88 88 // set new coroutine that task is executing 89 TL_GET( this_thread)->curr_cor = dst;89 active_thread()->curr_cor = dst; 90 90 91 91 // context switch to specified coroutine … … 112 112 // will also migrate which means this value will 113 113 // stay in syn with the TLS 114 $coroutine * src = TL_GET( this_thread )->curr_cor;114 $coroutine * src = active_coroutine(); 115 115 116 116 assertf( src->last != 0, … … 138 138 // will also migrate which means this value will 139 139 // stay in syn with the TLS 140 $coroutine * src = TL_GET( this_thread )->curr_cor;140 $coroutine * src = active_coroutine(); 141 141 $coroutine * dst = get_coroutine(cor); 142 142 143 143 if( unlikely(dst->context.SP == 0p) ) { 144 TL_GET( this_thread)->curr_cor = dst;144 active_thread()->curr_cor = dst; 145 145 __stack_prepare(&dst->stack, 65000); 146 146 __cfactx_start(main, dst, cor, __cfactx_invoke_coroutine); 147 TL_GET( this_thread)->curr_cor = src;147 active_thread()->curr_cor = src; 148 148 } 149 149 … … 175 175 // will also migrate which means this value will 176 176 // stay in syn with the TLS 177 $coroutine * src = TL_GET( this_thread )->curr_cor;177 $coroutine * src = active_coroutine(); 178 178 179 179 // not resuming self ?
Note: See TracChangeset
for help on using the changeset viewer.