From 250e30d73f09e9da2b5a81d0fbae63744ae12a73 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 2 Apr 2019 08:47:15 +0800 Subject: *misc --- source/libs/asura-lib-utils/threading/coroutine.h | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 source/libs/asura-lib-utils/threading/coroutine.h (limited to 'source/libs/asura-lib-utils/threading/coroutine.h') diff --git a/source/libs/asura-lib-utils/threading/coroutine.h b/source/libs/asura-lib-utils/threading/coroutine.h new file mode 100644 index 0000000..01af654 --- /dev/null +++ b/source/libs/asura-lib-utils/threading/coroutine.h @@ -0,0 +1,40 @@ +#ifndef __ASURA_COROUTINE_H__ +#define __ASURA_COROUTINE_H__ + +#include "../scripting/portable.hpp" + +namespace AsuraEngine +{ + namespace Threading + { + + /// + /// lua协程,用来做一些逻辑并发操作。 + /// + class Coroutine ASURA_FINAL + : public AEScripting::Portable + { + public: + + LUAX_DECL_FACTORY(Coroutine); + + + + private: + + /// + /// 当前协程的state + /// + lua_State* mThreadState; + + LUAX_DECL_METHOD(_New); + LUAX_DECL_METHOD(_Run); + + }; + + } +} + +namespace AEThreading = AsuraEngine::Threading; + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0