diff options
author | chai <chaifix@163.com> | 2019-03-27 09:07:54 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-27 09:07:54 +0800 |
commit | 66c5fdc564dd892ed265132d6c1378dbe3cebcee (patch) | |
tree | 909848ed622b35c8653c961c9ebed8c574bb150e /source/libs/asura-lib-utils/threading/thread.h | |
parent | d9041d6e12ded456c17622f7f2e7bbacb9e99b1a (diff) |
*misc
Diffstat (limited to 'source/libs/asura-lib-utils/threading/thread.h')
-rw-r--r-- | source/libs/asura-lib-utils/threading/thread.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/source/libs/asura-lib-utils/threading/thread.h b/source/libs/asura-lib-utils/threading/thread.h new file mode 100644 index 0000000..0058144 --- /dev/null +++ b/source/libs/asura-lib-utils/threading/thread.h @@ -0,0 +1,60 @@ +#ifndef __ASURA_THREAD_H__ +#define __ASURA_THREAD_H__ + +#include <queue> +#include <asura-lib-utils/scripting/portable.hpp> + +#include "thread_task.h" + +namespace AsuraEngine +{ + namespace Threading + { + + class ThreadImpl; + + /// + /// ߳壬ÿ߳άһtask queue + /// + class Thread ASURA_FINAL + : public AEScripting::Portable<Thread> + { + public: + + LUAX_DECL_FACTORY(Thread); + + bool Enqueue(ThreadTask* task); + + void Run(); + + private: + + /// + /// С + /// + std::queue<ThreadTask*> mTaskQueue; + + ThreadImpl* mImpl; + + LUAX_DECL_METHOD(_Enqueue); + LUAX_DECL_METHOD(_Run); + + }; + + /// + /// ̵߳ľʵ֣ûģһֲԣ + /// 1: win32 + /// 2: posix + /// 3: SDL + /// 4: std::thread + /// + ASURA_ABSTRACT class ThreadImpl + { + public: + + }; + + } +} + +#endif
\ No newline at end of file |