diff options
author | Alin Serdean <aserdean@cloudbasesolutions.com> | 2017-07-14 04:40:58 +0000 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-08-02 11:32:59 -0700 |
commit | 1e30f5fa96d84b7c500784220753b247726bb362 (patch) | |
tree | 2b336c955061c01deacef74844dde4033516c396 /datapath-windows | |
parent | 17cf43bce5b36413ac642793678cde4e8ed67711 (diff) | |
download | openvswitch-1e30f5fa96d84b7c500784220753b247726bb362.tar.gz |
datapath-windows: Fix shared variables which use Interlocked functions
Instead of assigning a value directly to the variable use `InterlockedAdd`
with 0.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Shashank Ram <rams@vmware.com>
Diffstat (limited to 'datapath-windows')
-rw-r--r-- | datapath-windows/ovsext/Switch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index 28c8ecf25..1ac4fa77c 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -143,7 +143,7 @@ OvsExtAttach(NDIS_HANDLE ndisFilterHandle, KeMemoryBarrier(); cleanup: - gOvsInAttach = FALSE; + InterlockedExchange(&gOvsInAttach, 0); if (status != NDIS_STATUS_SUCCESS) { if (switchContext != NULL) { OvsDeleteSwitch(switchContext); @@ -516,7 +516,7 @@ OvsReleaseSwitchContext(POVS_SWITCH_CONTEXT switchContext) LONG icxRef = 0; do { - ref = gOvsSwitchContextRefCount; + ref = InterlockedAdd(&gOvsSwitchContextRefCount, 0); newRef = (0 == ref) ? 0 : ref - 1; icxRef = InterlockedCompareExchange(&gOvsSwitchContextRefCount, newRef, @@ -538,7 +538,7 @@ OvsAcquireSwitchContext(VOID) BOOLEAN ret = FALSE; do { - ref = gOvsSwitchContextRefCount; + ref = InterlockedAdd(&gOvsSwitchContextRefCount, 0); newRef = (0 == ref) ? 0 : ref + 1; icxRef = InterlockedCompareExchange(&gOvsSwitchContextRefCount, newRef, |