mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[fix] stop threads when DestroyIceTransmission() called
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "io_statistics.h"
|
||||
|
||||
#include "log.h"
|
||||
|
||||
IOStatistics::IOStatistics(
|
||||
std::function<void(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t,
|
||||
uint32_t, uint32_t, uint32_t)>
|
||||
@@ -8,13 +10,7 @@ IOStatistics::IOStatistics(
|
||||
interval_ = 1000;
|
||||
}
|
||||
|
||||
IOStatistics::~IOStatistics() {
|
||||
running_ = false;
|
||||
cond_var_.notify_one();
|
||||
if (statistics_thread_.joinable()) {
|
||||
statistics_thread_.join();
|
||||
}
|
||||
}
|
||||
IOStatistics::~IOStatistics() {}
|
||||
|
||||
void IOStatistics::Process() {
|
||||
while (running_) {
|
||||
@@ -56,6 +52,14 @@ void IOStatistics::Start() {
|
||||
}
|
||||
}
|
||||
|
||||
void IOStatistics::Stop() {
|
||||
running_ = false;
|
||||
cond_var_.notify_one();
|
||||
if (statistics_thread_.joinable()) {
|
||||
statistics_thread_.join();
|
||||
}
|
||||
}
|
||||
|
||||
void IOStatistics::UpdateVideoInboundBytes(uint32_t bytes) {
|
||||
video_inbound_bytes_ += bytes;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ class IOStatistics {
|
||||
|
||||
public:
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
void UpdateVideoInboundBytes(uint32_t bytes);
|
||||
void UpdateVideoOutboundBytes(uint32_t bytes);
|
||||
|
||||
Reference in New Issue
Block a user