00001 00002 00003 #ifndef __thread_h__ 00004 #define __thread_h__ 00005 00006 00007 00008 #include "common.h" 00009 #include "id.h" 00010 00011 00012 00013 00015 class thread 00016 { 00017 friend class process; 00018 00019 public: 00021 thread(); 00022 00024 thread(address PC); 00025 00026 ~thread(); 00027 00030 void spawn(const address& PC); 00031 00033 address getAddress(); 00034 00036 bool isTerminated(); 00037 00039 thread& operator++(); 00040 00043 thread& operator+=(const int& i); 00044 00047 thread& operator%=(const int& i); 00048 00050 thread& operator=(const address& addr); 00051 00053 operator address(); 00054 00055 protected: 00057 address m_PC; 00058 00060 bool m_terminated; 00061 00062 private: 00063 }; 00064 00065 00066 00067 #endif 00068