summaryrefslogtreecommitdiffstats
path: root/src/server/globals.h
diff options
context:
space:
mode:
authorSimon Rettberg2018-08-13 13:56:27 +0200
committerSimon Rettberg2018-08-13 13:56:27 +0200
commit6f8012bd27f6a84ff1eb47abbbe1fb7443072e24 (patch)
tree7ba4e8aa3b9bcf38532418477a18dd6f99dc922a /src/server/globals.h
parent[SERVER] Use atomic var for (total)bytesSent counters (diff)
downloaddnbd3-6f8012bd27f6a84ff1eb47abbbe1fb7443072e24.tar.gz
dnbd3-6f8012bd27f6a84ff1eb47abbbe1fb7443072e24.tar.xz
dnbd3-6f8012bd27f6a84ff1eb47abbbe1fb7443072e24.zip
[SERVER] Use atomic vars for uplink byte counters
Diffstat (limited to 'src/server/globals.h')
-rw-r--r--src/server/globals.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/server/globals.h b/src/server/globals.h
index 84588c3..097df83 100644
--- a/src/server/globals.h
+++ b/src/server/globals.h
@@ -70,8 +70,7 @@ struct _dnbd3_connection
int nextReplicationIndex; // Which index in the cache map we should start looking for incomplete blocks at
// If BGR == BGR_HASHBLOCK, -1 means "currently no incomplete block"
uint64_t replicationHandle; // Handle of pending replication request
- uint64_t bytesReceived; // Number of bytes received by the connection.
- uint64_t lastBytesReceived; // Number of bytes received last time we updated the global counter.
+ atomic_uint_fast64_t bytesReceived; // Number of bytes received by the uplink since startup.
int queueLen; // length of queue
int idleCount; // How many iterations of keepalive check connection was idle
dnbd3_queued_request_t queue[SERVER_MAX_UPLINK_QUEUE];