|
KiCad PCB EDA Suite
|
Lock-free single-slot mailbox carrying frame state from the main thread to the render thread. More...
#include <frame_mailbox.h>
Public Member Functions | |
| FRAME_MAILBOX ()=default | |
| ~FRAME_MAILBOX () | |
| FRAME_MAILBOX (const FRAME_MAILBOX &)=delete | |
| FRAME_MAILBOX & | operator= (const FRAME_MAILBOX &)=delete |
| std::unique_ptr< FRAME_PACKET > | Submit (std::unique_ptr< FRAME_PACKET > aPacket) |
| std::unique_ptr< FRAME_PACKET > | Load () |
| uint64_t | ConsumedBufferGeneration () const |
| uint64_t | PendingInputSerial () const |
Private Attributes | |
| std::atomic< FRAME_PACKET * > | m_pending { nullptr } |
| std::atomic< uint64_t > | m_consumedGeneration { 0 } |
| std::atomic< uint64_t > | m_pendingInputSerial { 0 } |
Lock-free single-slot mailbox carrying frame state from the main thread to the render thread.
Only the latest packet is kept, so the render thread never draws a stale frame. One producer and one consumer may call Submit() and Load() concurrently.
Definition at line 38 of file frame_mailbox.h.
|
default |
Referenced by FRAME_MAILBOX(), and operator=().
|
inline |
Definition at line 43 of file frame_mailbox.h.
References m_pending.
|
delete |
References FRAME_MAILBOX().
|
inline |
Definition at line 87 of file frame_mailbox.h.
References m_consumedGeneration.
|
inline |
Older packets are never drawn again, so their retired buffers can be freed.
Definition at line 72 of file frame_mailbox.h.
References m_consumedGeneration, and m_pending.
Referenced by KIGFX::RENDER_THREAD::ProcessActiveWindows().
|
delete |
References FRAME_MAILBOX().
|
inline |
Definition at line 95 of file frame_mailbox.h.
References m_pendingInputSerial.
Referenced by KIGFX::RENDER_THREAD::ProcessActiveWindows().
|
inline |
Definition at line 54 of file frame_mailbox.h.
References m_pending, and m_pendingInputSerial.
|
private |
Definition at line 102 of file frame_mailbox.h.
Referenced by ConsumedBufferGeneration(), and Load().
|
private |
Definition at line 101 of file frame_mailbox.h.
Referenced by Load(), Submit(), and ~FRAME_MAILBOX().
|
private |
Definition at line 103 of file frame_mailbox.h.
Referenced by PendingInputSerial(), and Submit().