diff options
| author | Nicolas James <nj3ahxac@gmail.com> | 2026-04-08 00:56:40 +1000 |
|---|---|---|
| committer | Nicolas James <nj3ahxac@gmail.com> | 2026-04-08 00:56:40 +1000 |
| commit | eb9719cc8b9a308654ccd2c3bce8a7047b6e2a1a (patch) | |
| tree | 5e72b419d3dc900a35921be5e551b17552251769 /src/frame_span.cc | |
| parent | 69764a869d99e9abd0fbe10c2773d3556d7f35e8 (diff) | |
Refactor storing submissions into FrameSpan class, reduce AntiLag thread contention
Diffstat (limited to 'src/frame_span.cc')
| -rw-r--r-- | src/frame_span.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/frame_span.cc b/src/frame_span.cc new file mode 100644 index 0000000..732d6f3 --- /dev/null +++ b/src/frame_span.cc @@ -0,0 +1,24 @@ +#include "frame_span.hh" + +namespace low_latency { + +FrameSpan::FrameSpan(std::shared_ptr<TimestampPool::Handle> handle) + : head_handle(std::move(handle)) { + assert(this->head_handle); // Must not be null +} + +FrameSpan::~FrameSpan() {} + +void FrameSpan::update(std::shared_ptr<TimestampPool::Handle> handle) { + this->tail_handle = std::move(handle); +} + +void FrameSpan::await_completed() const { + if (this->tail_handle) { + this->tail_handle->await_end(); + return; + } + this->head_handle->await_end(); +} + +} // namespace low_latency
\ No newline at end of file |
