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: Guard rule statistics with a mutex.
[sliver-openvswitch.git]
/
lib
/
ofp-msgs.c
diff --git
a/lib/ofp-msgs.c
b/lib/ofp-msgs.c
index
5e043d2
..
d136f73
100644
(file)
--- a/
lib/ofp-msgs.c
+++ b/
lib/ofp-msgs.c
@@
-110,8
+110,11
@@
static enum ofperr ofpraw_from_ofphdrs(enum ofpraw *, const struct ofphdrs *);
static ovs_be32
alloc_xid(void)
{
- static uint32_t next_xid = 1;
- return htonl(next_xid++);
+ static atomic_uint32_t next_xid = ATOMIC_VAR_INIT(1);
+ uint32_t xid;
+
+ atomic_add(&next_xid, 1, &xid);
+ return htonl(xid);
}
\f
static uint32_t