-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paththread.h
40 lines (29 loc) · 864 Bytes
/
thread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __LINE_THREAD_H_
#define __LINE_THREAD_H_
#include <pthread.h>
#include <mach/mach_port.h>
#include <mach/mach_init.h>
class LineProcess;
class LineThread
{
private:
pthread_t m_pthread;
task_t m_task;
pthread_cond_t m_processSignalCond;
pthread_mutex_t m_processSignalCondMutex;
protected:
LineProcess* m_process;
public:
LineThread(LineProcess* process);
virtual ~LineThread();
void setPThread(pthread_t pthread) { m_pthread = pthread; }
pthread_t getPThread() { return m_pthread; }
task_t getTask() { return m_task; }
void start(int argc, char** argv, char** environ);
void initialEntry(int argc, char** argv, char** environ);
virtual void entry(int argc, char** argv, char** environ);
void singleStep(bool enable);
void waitForProcess();
void signalFromProcess();
};
#endif