Initial repository 1.0.0
This commit is contained in:
commit
d8b1275884
1861 files changed
+66342
No files matched your search
@@ -0,0 +1,51 @@
|
||||
#ifndef __Thread_h__
|
||||
#define __Thread_h__
|
||||
|
||||
#include "includes"
|
||||
#include "Log.h"
|
||||
#include "Object.h"
|
||||
#include "Session.h"
|
||||
|
||||
namespace core {
|
||||
|
||||
class EPoll;
|
||||
|
||||
///
|
||||
/// Thread
|
||||
///
|
||||
/// This thread object is designed to be the thread processor for the EPoll object. It wraps the thread
|
||||
/// object to allow maintaining a status value for monitoring the thread activity. EPoll will instantiate
|
||||
/// a Thread object for each thread specified in the EPoll's start method.
|
||||
///
|
||||
|
||||
class Thread : public Object {
|
||||
|
||||
public:
|
||||
Thread(EPoll &ePoll);
|
||||
~Thread();
|
||||
|
||||
///
|
||||
/// Start the thread object. This will cause the epoll scheduler to commence reading the epoll queue.
|
||||
///
|
||||
|
||||
void start();
|
||||
void join();
|
||||
std::string getStatus();
|
||||
pid_t getThreadId();
|
||||
int getCount();
|
||||
void output(Session *session);
|
||||
|
||||
private:
|
||||
EPoll &ePoll; // The EPoll control object.
|
||||
std::string status;
|
||||
int count;
|
||||
std::thread *_thread;
|
||||
void print_thread_start_log();
|
||||
pid_t threadId;
|
||||
void run();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user