Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/examples/Fib3.c

    ra573c22 r466fa01  
    22
    33typedef struct {
    4         int restart, fn1, fn;
     4        int fn1, fn;
     5        void * next;
    56} Fib;
    6 #define FibCtor { 0, 1, 0 }
     7#define FibCtor { 1, 0, NULL }
    78
    89Fib * comain( Fib * f ) {
    9         static void * states[] = {&&s0, &&s1};
    10         goto *states[f->restart];
    11   s0: f->restart = 1;
     10        if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
     11        f->next = &&s1;
    1212        for ( ;; ) {
    1313                return f;
Note: See TracChangeset for help on using the changeset viewer.