diff options
Diffstat (limited to 'src/server/uplink.c')
-rw-r--r-- | src/server/uplink.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/server/uplink.c b/src/server/uplink.c index d76f030..e1c776b 100644 --- a/src/server/uplink.c +++ b/src/server/uplink.c @@ -48,14 +48,6 @@ uint64_t uplink_getTotalBytesReceived() return tmp; } -void uplink_addTotalBytesReceived(int receivedBytes) -{ - spin_lock( &statisticsReceivedLock ); - totalBytesReceived += receivedBytes; - spin_unlock( &statisticsReceivedLock ); - return; -} - /** * Create and initialize an uplink instance for the given * image. Uplinks run in their own thread. @@ -452,7 +444,9 @@ static void* uplink_mainloop(void *data) spin_destroy( &link->queueLock ); free( link->recvBuffer ); link->recvBuffer = NULL; - uplink_addTotalBytesReceived( link->bytesReceived ); + spin_lock( &statisticsReceivedLock ); + totalBytesReceived += link->bytesReceived; + spin_unlock( &statisticsReceivedLock ); free( link ); return NULL ; } |