MCPcopy Create free account
hub / github.com/TzuHuanTai/RaspberryPi-WebRTC / push

Method push

src/common/thread_safe_queue.h:19–29  ·  view source on GitHub ↗

Return false when the queue is full.

Source from the content-addressed store, hash-verified

17
18 // Return false when the queue is full.
19 bool push(T t) {
20 {
21 std::lock_guard<std::mutex> lock(mutex_);
22 if (queue_.size() >= max_size_) {
23 return false;
24 }
25 queue_.push(std::move(t));
26 }
27 cv_.notify_one();
28 return true;
29 }
30
31 // blocking pop with timeout
32 std::optional<T> pop(int timeout_ms) {

Callers 8

OnBufferMethod · 0.80
PrepareBufferMethod · 0.80
EmplaceBufferMethod · 0.80
CaptureBufferMethod · 0.80
~JetsonScalerMethod · 0.80
InitializeMethod · 0.80
EmplaceBufferMethod · 0.80
EmplaceBufferMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected