summaryrefslogtreecommitdiffstats
path: root/fnet
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2020-02-04 14:45:04 +0000
committerHåvard Pettersen <havardpe@oath.com>2020-02-04 14:45:04 +0000
commite1291b03db1a536baba04fa899a99f5450304b99 (patch)
tree881b66919312047b9603ad181d4e2c83a561e5dd /fnet
parentb0f12f2e14682e322bd8e43500378fe0ffd4a6ae (diff)
use relaxed add/sub
Diffstat (limited to 'fnet')
-rw-r--r--fnet/src/vespa/fnet/connection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/fnet/src/vespa/fnet/connection.cpp b/fnet/src/vespa/fnet/connection.cpp
index bf29cc29c18..5f7adb32af0 100644
--- a/fnet/src/vespa/fnet/connection.cpp
+++ b/fnet/src/vespa/fnet/connection.cpp
@@ -491,7 +491,7 @@ FNET_Connection::FNET_Connection(FNET_TransportThread *owner,
_cleanup(nullptr)
{
assert(_socket && (_socket->get_fd() >= 0));
- ++_num_connections;
+ _num_connections.fetch_add(1, std::memory_order_relaxed);
}
@@ -529,7 +529,7 @@ FNET_Connection::FNET_Connection(FNET_TransportThread *owner,
_adminChannel = admin.get();
_channels.Register(admin.release());
}
- ++_num_connections;
+ _num_connections.fetch_add(1, std::memory_order_relaxed);
}
@@ -540,7 +540,7 @@ FNET_Connection::~FNET_Connection()
delete _adminChannel;
}
assert(_cleanup == nullptr);
- --_num_connections;
+ _num_connections.fetch_sub(1, std::memory_order_relaxed);
}