~vcs-imports/junkcode/main

« back to all changes in this revision

Viewing changes to ping_pong.c

  • Committer: tridge
  • Date: 2007-06-22 14:02:40 UTC
  • Revision ID: vcs-imports@canonical.com-20070622140240-czkubwpxta5ghbdu
only show the increment after a full pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
static void ping_pong(int fd, int num_locks)
68
68
{
69
69
        unsigned count = 0;
70
 
        int i=0;
 
70
        int i=0, loops=0;
71
71
        unsigned char *val;
72
72
        unsigned char incr=0, last_incr=0;
73
73
        unsigned char *p = NULL;
114
114
                }
115
115
                i = (i+1) % num_locks;
116
116
                count++;
117
 
                if (incr != last_incr) {
 
117
                if (loops > num_locks && incr != last_incr) {
118
118
                        last_incr = incr;
119
119
                        printf("data increment = %u\n", incr);
120
120
                        fflush(stdout);
126
126
                        start_timer();
127
127
                        count=0;
128
128
                }
 
129
                loops++;
129
130
        }
130
131
}
131
132