File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ consumer_queue::~consumer_queue() {
23
23
24
24
void consumer_queue::push_sample (const sample_p &sample) {
25
25
// acquire lock for more predictable behavior in regards to pop_sample()
26
- std::unique_lock<std::mutex> lk (lock_ );
26
+ std::unique_lock<std::mutex> lk (mut_ );
27
27
while (!buffer_.push (sample)) {
28
28
sample_p dummy;
29
29
buffer_.pop (dummy);
@@ -37,8 +37,8 @@ sample_p consumer_queue::pop_sample(double timeout) {
37
37
buffer_.pop (result);
38
38
} else {
39
39
if (!buffer_.pop (result)) {
40
- // wait untill for a new sample until the thread calling push_sample delivers one, or until timeout
41
- std::unique_lock<std::mutex> lk (lock_ );
40
+ // wait for a new sample until the thread calling push_sample delivers one, or until timeout
41
+ std::unique_lock<std::mutex> lk (mut_ );
42
42
std::chrono::duration<double > sec (timeout);
43
43
cv_.wait_for (lk, sec, [&]{ return this ->buffer_ .pop (result); });
44
44
}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class consumer_queue {
55
55
send_buffer_p registry_; // optional consumer registry
56
56
buffer_type buffer_; // the sample buffer
57
57
// used to wait for new samples
58
- std::mutex lock_ ;
58
+ std::mutex mut_ ;
59
59
std::condition_variable cv_;
60
60
};
61
61
You can’t perform that action at this time.
0 commit comments