Jetson Inference
DNN Vision Library

Event object for signalling other threads. More...

#include <Event.h>

Public Member Functions

 Event (bool auto_reset=true)
 Event constructor. More...
 
 ~Event ()
 Destructor. More...
 
void Wake ()
 Raise the event. More...
 
void Reset ()
 Reset the event status to un-raised. More...
 
bool Query ()
 Query the status of this event. More...
 
bool Wait ()
 Wait until this event is raised. More...
 
bool Wait (const timespec &timeout)
 Wait for a specified amount of time until this event is raised or timeout occurs. More...
 
bool Wait (uint64_t timeout)
 Wait for a specified number of milliseconds until this event is raised or timeout occurs. More...
 
bool WaitNs (uint64_t timeout)
 Wait for a specified number of nanoseconds until this event is raised or timeout occurs. More...
 
bool WaitUs (uint64_t timeout)
 Wait for a specified number of microseconds until this event is raised or timeout occurs. More...
 
pthread_cond_t * GetID ()
 Get the Event object. More...
 

Protected Attributes

pthread_cond_t mID
 
Mutex mQueryMutex
 
bool mQuery
 
bool mAutoReset
 

Detailed Description

Event object for signalling other threads.

Constructor & Destructor Documentation

◆ Event()

Event::Event ( bool  auto_reset = true)
inline

Event constructor.

By default, it will automatically be reset when it's raised.

Parameters
auto_resetOnce this event has been raised, should it automatically be reset?

◆ ~Event()

Event::~Event ( )
inline

Destructor.

Member Function Documentation

◆ GetID()

pthread_cond_t* Event::GetID ( )
inline

Get the Event object.

◆ Query()

bool Event::Query ( )
inline

Query the status of this event.

Returns
True if the event is raised, false if not.

◆ Reset()

void Event::Reset ( )
inline

Reset the event status to un-raised.

◆ Wait() [1/3]

bool Event::Wait ( )
inline

Wait until this event is raised.

It is likely this will block this thread (and will never timeout).

See also
Wake

◆ Wait() [2/3]

bool Event::Wait ( const timespec &  timeout)
inline

Wait for a specified amount of time until this event is raised or timeout occurs.

See also
Wake

◆ Wait() [3/3]

bool Event::Wait ( uint64_t  timeout)
inline

Wait for a specified number of milliseconds until this event is raised or timeout occurs.

See also
Wake

◆ WaitNs()

bool Event::WaitNs ( uint64_t  timeout)
inline

Wait for a specified number of nanoseconds until this event is raised or timeout occurs.

See also
Wake

◆ WaitUs()

bool Event::WaitUs ( uint64_t  timeout)
inline

Wait for a specified number of microseconds until this event is raised or timeout occurs.

See also
Wake

◆ Wake()

void Event::Wake ( )
inline

Raise the event.

Any threads waiting on this event will be woken up.

Member Data Documentation

◆ mAutoReset

bool Event::mAutoReset
protected

◆ mID

pthread_cond_t Event::mID
protected

◆ mQuery

bool Event::mQuery
protected

◆ mQueryMutex

Mutex Event::mQueryMutex
protected

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