aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Thread/Thread.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-07 00:27:46 +0800
committerchai <chaifix@163.com>2018-09-07 00:27:46 +0800
commit5e4a2c8fa58f30a93506c1db21aa7a9921c0affc (patch)
tree644837c30568296c311eb68b199048ad5f3b8a83 /src/libjin/Thread/Thread.h
parentd395ac00770e1dad6f9a2ba98ef23b8b719d0d16 (diff)
*format source code
Diffstat (limited to 'src/libjin/Thread/Thread.h')
-rw-r--r--src/libjin/Thread/Thread.h13
1 files changed, 8 insertions, 5 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);