diff options
author | Simon Rettberg | 2018-08-08 12:09:14 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-08-08 12:09:14 +0200 |
commit | 2860f3393025e114f11feb1b576d2ac6353fbd23 (patch) | |
tree | 51a66fbf9dccff3ee0d7cc905cab7c7ab40911b5 /src/server/uplink.c | |
parent | [SHARED] Use atomic for logger mask (diff) | |
download | dnbd3-2860f3393025e114f11feb1b576d2ac6353fbd23.tar.gz dnbd3-2860f3393025e114f11feb1b576d2ac6353fbd23.tar.xz dnbd3-2860f3393025e114f11feb1b576d2ac6353fbd23.zip |
[SERVER] Use atomic var for (total)bytesSent counters
Gets rid of the lastBytesSent field as well as the stats lock per
client. Cleaned and split up the messy net_clientsToJson function while
at it.
Diffstat (limited to 'src/server/uplink.c')
-rw-r--r-- | src/server/uplink.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/server/uplink.c b/src/server/uplink.c index da63d82..879d08c 100644 --- a/src/server/uplink.c +++ b/src/server/uplink.c @@ -802,12 +802,10 @@ static void uplink_handleReceive(dnbd3_connection_t *link) bytesSent = (size_t)sent - sizeof outReply; } } - spin_lock( &client->statsLock ); pthread_mutex_unlock( &client->sendMutex ); if ( bytesSent != 0 ) { client->bytesSent += bytesSent; } - spin_unlock( &client->statsLock ); spin_lock( &link->queueLock ); } if ( req->status == ULR_FREE && i == link->queueLen - 1 ) link->queueLen--; |