git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto-dpif-upcall: Fix a race.
[sliver-openvswitch.git]
/
ofproto
/
ofproto-dpif-upcall.c
diff --git
a/ofproto/ofproto-dpif-upcall.c
b/ofproto/ofproto-dpif-upcall.c
index
b931ab6
..
5b5fb6e
100644
(file)
--- a/
ofproto/ofproto-dpif-upcall.c
+++ b/
ofproto/ofproto-dpif-upcall.c
@@
-695,7
+695,10
@@
udpif_upcall_handler(void *arg)
size_t i;
ovs_mutex_lock(&handler->mutex);
size_t i;
ovs_mutex_lock(&handler->mutex);
- if (!handler->n_upcalls) {
+ /* Must check the 'exit_latch' again to make sure the main thread is
+ * not joining on the handler thread. */
+ if (!handler->n_upcalls
+ && !latch_is_set(&handler->udpif->exit_latch)) {
ovs_mutex_cond_wait(&handler->wake_cond, &handler->mutex);
}
ovs_mutex_cond_wait(&handler->wake_cond, &handler->mutex);
}