- File:
-
- 1 edited
-
src/libcfa/concurrency/coroutine (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutine
r14a61b5 rde6319f 72 72 // Suspend implementation inlined for performance 73 73 static inline void suspend() { 74 // optimization : read TLS once and reuse it 75 // Safety note: this is preemption safe since if 76 // preemption occurs after this line, the pointer 77 // will also migrate which means this value will 78 // stay in syn with the TLS 79 coroutine_desc * src = TL_GET( this_coroutine ); 74 coroutine_desc * src = TL_GET( this_coroutine ); // optimization 80 75 81 76 assertf( src->last != 0, … … 94 89 forall(dtype T | is_coroutine(T)) 95 90 static inline void resume(T & cor) { 96 // optimization : read TLS once and reuse it 97 // Safety note: this is preemption safe since if 98 // preemption occurs after this line, the pointer 99 // will also migrate which means this value will 100 // stay in syn with the TLS 101 coroutine_desc * src = TL_GET( this_coroutine ); 91 coroutine_desc * src = TL_GET( this_coroutine ); // optimization 102 92 coroutine_desc * dst = get_coroutine(cor); 103 93 … … 117 107 dst->last = src; 118 108 dst->starter = dst->starter ? dst->starter : src; 119 } 109 } // if 120 110 121 111 // always done for performance testing … … 124 114 125 115 static inline void resume(coroutine_desc * dst) { 126 // optimization : read TLS once and reuse it 127 // Safety note: this is preemption safe since if 128 // preemption occurs after this line, the pointer 129 // will also migrate which means this value will 130 // stay in syn with the TLS 131 coroutine_desc * src = TL_GET( this_coroutine ); 116 coroutine_desc * src = TL_GET( this_coroutine ); // optimization 132 117 133 118 // not resuming self ? … … 140 125 // set last resumer 141 126 dst->last = src; 142 } 127 } // if 143 128 144 129 // always done for performance testing
Note:
See TracChangeset
for help on using the changeset viewer.