Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FPThreadEvent Class Reference

#include <PThreadEvent.h>

+ Inheritance diagram for FPThreadEvent:
+ Collaboration diagram for FPThreadEvent:

Public Member Functions

 FPThreadEvent ()
 
virtual ~FPThreadEvent ()
 
virtual bool Create (bool _bIsManualReset=false) override
 
virtual bool IsManualReset () override
 
virtual void Trigger () override
 
virtual void Reset () override
 
virtual bool Wait (uint32 WaitTime=(uint32) -1, const bool bIgnoreThreadIdleStats=false) override
 
- Public Member Functions inherited from FEvent
bool Wait ()
 
bool Wait (const FTimespan &WaitTime, const bool bIgnoreThreadIdleStats=false)
 
 FEvent ()
 
virtual ~FEvent ()
 
void AdvanceStats ()
 

Private Types

enum  TriggerType { TRIGGERED_NONE , TRIGGERED_ONE , TRIGGERED_ALL }
 

Private Member Functions

void LockEventMutex ()
 
void UnlockEventMutex ()
 

Static Private Member Functions

static void SubtractTimevals (const struct timeval *FromThis, struct timeval *SubThis, struct timeval *Difference)
 

Private Attributes

bool bInitialized
 
bool bIsManualReset
 
volatile TriggerType Triggered
 
volatile int32 WaitingThreads
 
pthread_mutex_t Mutex
 
pthread_cond_t Condition
 

Additional Inherited Members

- Protected Member Functions inherited from FEvent
void WaitForStats ()
 
void TriggerForStats ()
 
void ResetForStats ()
 
- Protected Attributes inherited from FEvent
uint32 EventId
 
TAtomic< uint32EventStartCycles
 
- Static Protected Attributes inherited from FEvent
static TAtomic< uint32EventUniqueId
 

Detailed Description

This is the PThreads version of FEvent.

Definition at line 13 of file PThreadEvent.h.

Member Enumeration Documentation

◆ TriggerType

Enumerator
TRIGGERED_NONE 
TRIGGERED_ONE 
TRIGGERED_ALL 

Definition at line 17 of file PThreadEvent.h.

Constructor & Destructor Documentation

◆ FPThreadEvent()

FPThreadEvent::FPThreadEvent ( )
inline

Definition at line 65 of file PThreadEvent.h.

◆ ~FPThreadEvent()

virtual FPThreadEvent::~FPThreadEvent ( )
inlinevirtual

Definition at line 73 of file PThreadEvent.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ Create()

virtual bool FPThreadEvent::Create ( bool bIsManualReset = false)
inlineoverridevirtual

Creates the event.

Manually reset events stay triggered until reset. Named events share the same underlying event.

Parameters
bIsManualResetWhether the event requires manual reseting or not.
Returns
true if the event was created, false otherwise.

Implements FEvent.

Definition at line 102 of file PThreadEvent.h.

◆ IsManualReset()

virtual bool FPThreadEvent::IsManualReset ( )
inlineoverridevirtual

Whether the signaled state of this event needs to be reset manually.

Returns
true if the state requires manual resetting, false otherwise.
See also
Reset

Implements FEvent.

Definition at line 124 of file PThreadEvent.h.

◆ LockEventMutex()

void FPThreadEvent::LockEventMutex ( )
inlineprivate

Definition at line 31 of file PThreadEvent.h.

+ Here is the caller graph for this function:

◆ Reset()

virtual void FPThreadEvent::Reset ( )
inlineoverridevirtual

Resets the event to an untriggered (waitable) state.

See also
IsManualReset, Trigger

Implements FEvent.

Definition at line 156 of file PThreadEvent.h.

+ Here is the call graph for this function:

◆ SubtractTimevals()

static void FPThreadEvent::SubtractTimevals ( const struct timeval * FromThis,
struct timeval * SubThis,
struct timeval * Difference )
inlinestaticprivate

Definition at line 43 of file PThreadEvent.h.

◆ Trigger()

virtual void FPThreadEvent::Trigger ( )
inlineoverridevirtual

Triggers the event so any waiting threads are activated.

See also
IsManualReset, Reset

Implements FEvent.

Definition at line 129 of file PThreadEvent.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnlockEventMutex()

void FPThreadEvent::UnlockEventMutex ( )
inlineprivate

Definition at line 37 of file PThreadEvent.h.

+ Here is the caller graph for this function:

◆ Wait()

virtual bool FPThreadEvent::Wait ( uint32 WaitTime = (uint32) -1,
const bool bIgnoreThreadIdleStats = false )
overridevirtual

Waits the specified amount of time for the event to be triggered.

A wait time of MAX_uint32 is treated as infinite wait.

Parameters
WaitTimeThe time to wait (in milliseconds).
bIgnoreThreadIdleStatsIf true, ignores ThreadIdleStats
Returns
true if the event was triggered, false if the wait timed out.

Implements FEvent.

Member Data Documentation

◆ bInitialized

bool FPThreadEvent::bInitialized
private

Definition at line 24 of file PThreadEvent.h.

◆ bIsManualReset

bool FPThreadEvent::bIsManualReset
private

Definition at line 25 of file PThreadEvent.h.

◆ Condition

pthread_cond_t FPThreadEvent::Condition
private

Definition at line 29 of file PThreadEvent.h.

◆ Mutex

pthread_mutex_t FPThreadEvent::Mutex
private

Definition at line 28 of file PThreadEvent.h.

◆ Triggered

volatile TriggerType FPThreadEvent::Triggered
private

Definition at line 26 of file PThreadEvent.h.

◆ WaitingThreads

volatile int32 FPThreadEvent::WaitingThreads
private

Definition at line 27 of file PThreadEvent.h.


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