diff options
author | chai <chaifix@163.com> | 2018-09-07 00:27:46 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-09-07 00:27:46 +0800 |
commit | 5e4a2c8fa58f30a93506c1db21aa7a9921c0affc (patch) | |
tree | 644837c30568296c311eb68b199048ad5f3b8a83 /src/libjin/Thread | |
parent | d395ac00770e1dad6f9a2ba98ef23b8b719d0d16 (diff) |
*format source code
Diffstat (limited to 'src/libjin/Thread')
-rw-r--r-- | src/libjin/Thread/Thread.h | 13 | ||||
-rw-r--r-- | src/libjin/Thread/thread.h | 13 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/libjin/Thread/Thread.h b/src/libjin/Thread/Thread.h index 046c8f6..3300b4f 100644 --- a/src/libjin/Thread/Thread.h +++ b/src/libjin/Thread/Thread.h @@ -78,26 +78,29 @@ namespace thread class ThreadData { public: + static const int SLOT_ERROR = -1; + static const int SLOT_WARN = -2; + static const int SLOT_INFO = -3; + static const int SLOT_DEBUG = -4; + ThreadData(Mutex*, Conditional*); ~ThreadData(); bool exist(int slot); void set(int slot, Variant value); Variant get(int slot); void remove(int slot); + Conditional* condition; Mutex* mutex; - static const int SLOT_ERROR = -1; - static const int SLOT_WARN = -2; - static const int SLOT_INFO = -3; - static const int SLOT_DEBUG = -4; - private: std::map<int, Variant> share; // threads shared value + }; public: typedef int(*ThreadRunner)(void* obj); + Thread(const std::string name, ThreadRunner threadfuncs); ~Thread(); bool start(void* p); diff --git a/src/libjin/Thread/thread.h b/src/libjin/Thread/thread.h index 046c8f6..3300b4f 100644 --- a/src/libjin/Thread/thread.h +++ b/src/libjin/Thread/thread.h @@ -78,26 +78,29 @@ namespace thread class ThreadData { public: + static const int SLOT_ERROR = -1; + static const int SLOT_WARN = -2; + static const int SLOT_INFO = -3; + static const int SLOT_DEBUG = -4; + ThreadData(Mutex*, Conditional*); ~ThreadData(); bool exist(int slot); void set(int slot, Variant value); Variant get(int slot); void remove(int slot); + Conditional* condition; Mutex* mutex; - static const int SLOT_ERROR = -1; - static const int SLOT_WARN = -2; - static const int SLOT_INFO = -3; - static const int SLOT_DEBUG = -4; - private: std::map<int, Variant> share; // threads shared value + }; public: typedef int(*ThreadRunner)(void* obj); + Thread(const std::string name, ThreadRunner threadfuncs); ~Thread(); bool start(void* p); |