EvEmu
0.8.4
11 September 2021
|
#include "Threading.h"
Public Member Functions | |
uint8 | Count () |
Threading.cpp | |
lightweight thread pool specifically for EvEmu Sockets this code is very basic and very specific. : Allan
| |
Threading () | |
~Threading () | |
void | Initialize () |
void | RunLoop () |
void | Process () |
void | AddSocket (SOCKET soc) |
void | AddThread (pthread_t thread) |
void | RemoveThread (pthread_t thread) |
void | CreateThread (void *(*start_routine)(void *), void *args) |
void | EndThreads () |
void | ListThreads () |
![]() | |
Singleton () | |
Primary constructor. More... | |
Protected Attributes | |
char * | buf |
fd_set | rSoc |
fd_set | wSoc |
struct timeval | tv |
uint8 | nfds |
uint8 | sleepTime |
uint32 | bufferLen |
Private Attributes | |
std::vector< pthread_t > | m_threads |
Additional Inherited Members | |
![]() | |
static Threading & | get () |
![]() | |
static std::shared_ptr< Threading > | mInstance |
Definition at line 16 of file Threading.h.
Threading::Threading | ( | ) |
update this to use thread pools and strictly for network sockets
Definition at line 22 of file Threading.cpp.
Threading::~Threading | ( | ) |
void Threading::AddSocket | ( | SOCKET | soc | ) |
void Threading::AddThread | ( | pthread_t | thread | ) |
Definition at line 100 of file Threading.cpp.
References _log, and m_threads.
Referenced by CreateThread().
|
inline |
void Threading::CreateThread | ( | void *(*)(void *) | start_routine, |
void * | args | ||
) |
Definition at line 88 of file Threading.cpp.
References _log, and AddThread().
void Threading::EndThreads | ( | ) |
void Threading::Initialize | ( | ) |
void Threading::ListThreads | ( | ) |
void Threading::Process | ( | ) |
void Threading::RemoveThread | ( | pthread_t | thread | ) |
void Threading::RunLoop | ( | ) |
Definition at line 46 of file Threading.cpp.
References Process(), Sleep(), and sleepTime.
|
protected |
Definition at line 37 of file Threading.h.
Referenced by Process().
|
protected |
Definition at line 43 of file Threading.h.
Referenced by Initialize(), and Process().
|
private |
Definition at line 46 of file Threading.h.
Referenced by AddThread(), Count(), EndThreads(), Initialize(), ListThreads(), RemoveThread(), and ~Threading().
|
protected |
Definition at line 41 of file Threading.h.
Referenced by AddSocket(), Initialize(), and Process().
|
protected |
Definition at line 38 of file Threading.h.
Referenced by AddSocket(), and Process().
|
protected |
Definition at line 42 of file Threading.h.
Referenced by Initialize(), and RunLoop().
|
protected |
Definition at line 39 of file Threading.h.
Referenced by Initialize(), and Process().
|
protected |
Definition at line 38 of file Threading.h.
Referenced by AddSocket(), and Process().