UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
wait_obj Struct Reference

#include <wait_obj.h>

Collaboration diagram for wait_obj:
Collaboration graph

Public Member Functions

 wait_obj ()
 
void notify ()
 
void reset ()
 
void wait ()
 

Private Attributes

std::condition_variable m_cv
 
std::mutex m_lock
 
bool m_val
 

Detailed Description

Definition at line 45 of file wait_obj.h.

Constructor & Destructor Documentation

◆ wait_obj()

wait_obj::wait_obj ( )
inline

Definition at line 47 of file wait_obj.h.

47 : m_val(false) {
48 }
bool m_val
Definition wait_obj.h:66

Referenced by wait_obj_done(), and wait_obj_init().

Member Function Documentation

◆ notify()

void wait_obj::notify ( )
inline

Definition at line 57 of file wait_obj.h.

57 {
58 std::unique_lock<std::mutex> lk(m_lock);
59 m_val = true;
60 lk.unlock();
61 m_cv.notify_one();
62 }
std::condition_variable m_cv
Definition wait_obj.h:65
std::mutex m_lock
Definition wait_obj.h:64

References m_cv, m_lock, and m_val.

Referenced by wait_obj_notify().

◆ reset()

void wait_obj::reset ( )
inline

Definition at line 53 of file wait_obj.h.

53 {
54 std::lock_guard<std::mutex> lk(m_lock);
55 m_val = false;
56 }

References m_lock, and m_val.

Referenced by wait_obj_reset().

◆ wait()

void wait_obj::wait ( )
inline

Definition at line 49 of file wait_obj.h.

49 {
50 std::unique_lock<std::mutex> lk(m_lock);
51 m_cv.wait(lk, [this] { return m_val; });
52 }

References m_cv, m_lock, and m_val.

Referenced by wait_obj_wait().

Member Data Documentation

◆ m_cv

std::condition_variable wait_obj::m_cv
private

Definition at line 65 of file wait_obj.h.

Referenced by notify(), and wait().

◆ m_lock

std::mutex wait_obj::m_lock
private

Definition at line 64 of file wait_obj.h.

Referenced by notify(), reset(), and wait().

◆ m_val

bool wait_obj::m_val
private

Definition at line 66 of file wait_obj.h.

Referenced by notify(), reset(), and wait().


The documentation for this struct was generated from the following file: