ofproto-dpif-upcall: Fix logic error in handler/revalidator threads
authorAlex Wang <alexw@nicira.com>
Tue, 22 Apr 2014 03:05:08 +0000 (20:05 -0700)
committerAlex Wang <alexw@nicira.com>
Tue, 22 Apr 2014 04:14:04 +0000 (21:14 -0700)
commit3aadc5bbb058d52bb350424cbfef80f2d0c50ecd
tree0090b84549bc004f9294dd9c1d740f84ab0676aa
parent1f8675481e8cc976931bd0a85851d780f7cf2a33
ofproto-dpif-upcall: Fix logic error in handler/revalidator threads
creation and deletion.

Commit 1f8675481e (ofproto-dpif-upcall: Fix ovs-vswitchd crash.)
directly copied the udpif_set_threads() logic to udpif_stop_threads()
and udpif_start_threads().  In fact, this was erroneous and caused
unittest failures.

This commit fixes the above issue by correcting the checks in
udpif_stop_threads() and udpif_start_threads(), and adding necessary
checks in udpif_set_threads().

Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
ofproto/ofproto-dpif-upcall.c