> + /* For threads other than main thread, wait for timewarp. */ > + if (ovsthread_id_self()) { > + timewarp_wait(); > + } > +
Why do we need the special case for the main thread btw? Does it really matter if it wakes up twice? > + if (timewarp_enabled) { > + /* Changes 'timewarp_seq' to wake up all waiting thread. */ > + seq_change(timewarp_seq); > + } I'd expect that timewarp would always be enabled here, or if it isn't, incrementing the seq won't hurt anything, may as well ditch the if statement. Also I don't think the comment is adding anything that isn't obvious from the code. If you don't disagree with my previous comments, I'll just fold them in and merge. Acked-by: Ethan Jackson <et...@nicira.com> > unixctl_command_reply(conn, "warped"); > } > > void > timeval_dummy_register(void) > { > + timewarp_enabled = true; > unixctl_command_register("time/stop", "", 0, 0, timeval_stop_cb, NULL); > unixctl_command_register("time/warp", "MSECS", 1, 1, > timeval_warp_cb, NULL); > diff --git a/lib/timeval.h b/lib/timeval.h > index 99b3af0..1bbfd5c 100644 > --- a/lib/timeval.h > +++ b/lib/timeval.h > @@ -69,6 +69,8 @@ int get_cpu_usage(void); > > long long int time_boot_msec(void); > > +void timewarp_wait(void); > + > #ifdef __cplusplus > } > #endif > -- > 1.7.9.5 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev