code: private static int next_idx( long [] tl ) {
      // Spin until we can CAS-acquire a fresh index
      while( true ) {
        int oldidx = (int)tl[0];
        int newidx = (oldidx+1)&(MAX_EVENTS-1);
        if( CAS( tl, 0, oldidx, newidx ) )
          return oldidx;
      }
    }
docs: Return the next index into the TIMELINE array