ovs-thread: Implement OVS specific barrier.
authorAlex Wang <alexw@nicira.com>
Thu, 29 May 2014 22:37:37 +0000 (15:37 -0700)
committerAlex Wang <alexw@nicira.com>
Mon, 7 Jul 2014 18:27:58 +0000 (11:27 -0700)
commit6b1585a0ffeb8f7cb2e11bbe45b083b9804a6eaf
treec86ebc464958a7fb583971ece9248e675d55f371
parent64b732912c203bf2e95684c26241118f07c2c786
ovs-thread: Implement OVS specific barrier.

Non-leader revalidator thread uses pthread_barrier_* functions in their
main loop to synchronize with leader thread.  However, since those threads
only call poll_block() intermittently, the poll interval check in
poll_block() can wrongly take the time since last call as poll interval
and issue the following warnings:

"Unreasonably long XXXXms poll interval".

To prevent it, this commit implements the barrier struct and operations
for OVS which allow thread to block on barrier via poll_block().

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/ovs-thread.c
lib/ovs-thread.h
ofproto/ofproto-dpif-upcall.c