Changes in / [8a9a3ab:4c0fa03]


Ignore:
Location:
libcfa/src/concurrency
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/coroutine.cfa

    r8a9a3ab r4c0fa03  
    344344bool poll() libcfa_public { return poll( active_coroutine() ); }
    345345coroutine$ * resumer() libcfa_public { return active_coroutine()->last; }
    346 coroutine$ * first_resumer() libcfa_public { return active_coroutine()->starter; }
    347346
    348347// user facing ehm operations
     
    359358
    360359    coroutine$ * resumer( T & cor ) libcfa_public { return get_coroutine( cor )->last; }
    361     coroutine$ * first_resumer( T & cor ) libcfa_public { return get_coroutine( cor )->starter; }
    362360}
    363361
  • libcfa/src/concurrency/coroutine.hfa

    r8a9a3ab r4c0fa03  
    124124        src->state = Active;
    125125
    126         if( unlikely(src->cancellation != 0p && src->cancellation != 1p) ) {
     126        if( unlikely(src->cancellation != 0p) ) {
    127127                __cfactx_coroutine_unwind(src->cancellation, src);
    128128        }
     
    169169        coroutine$ * dst = get_coroutine(cor);
    170170
    171     // printf("FROM RES src: %p, dest: %p\n", src, dst);
    172 
    173171        if( unlikely(dst->context.SP == 0p) ) {
    174172                __stack_prepare(&dst->stack, DEFAULT_STACK_SIZE);
     
    190188        // always done for performance testing
    191189        $ctx_switch( src, dst );
    192 
    193         if ( unlikely(src->cancellation == 1p) ) {
    194         src->cancellation = 0p;
    195         // we know dst hasn't been deallocated
     190        if ( unlikely(dst->cancellation) ) {
    196191                __cfaehm_cancelled_coroutine( cor, dst, _default_vtable );
    197192        }
     
    227222bool poll();
    228223coroutine$ * resumer();
    229 coroutine$ * first_resumer();
    230224
    231225forall(T & | is_coroutine(T)) {
     
    235229    bool checked_poll( T & cor );
    236230    coroutine$ * resumer( T & cor );
    237     coroutine$ * first_resumer( T & cor );
    238231}
    239232
  • libcfa/src/concurrency/exception.cfa

    r8a9a3ab r4c0fa03  
    5757        struct coroutine$ * src = (coroutine$ *)stop_param;
    5858        struct coroutine$ * dst = src->last;
    59     dst->cancellation = 1p;
     59
    6060        $ctx_switch( src, dst );
    6161        abort();
Note: See TracChangeset for help on using the changeset viewer.