Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/coroutine

    r14a61b5 rde6319f  
    7272// Suspend implementation inlined for performance
    7373static 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
    8075
    8176        assertf( src->last != 0,
     
    9489forall(dtype T | is_coroutine(T))
    9590static 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
    10292        coroutine_desc * dst = get_coroutine(cor);
    10393
     
    117107                dst->last = src;
    118108                dst->starter = dst->starter ? dst->starter : src;
    119         }
     109        } // if
    120110
    121111        // always done for performance testing
     
    124114
    125115static 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
    132117
    133118        // not resuming self ?
     
    140125                // set last resumer
    141126                dst->last = src;
    142         }
     127        } // if
    143128
    144129        // always done for performance testing
Note: See TracChangeset for help on using the changeset viewer.