diff options
Diffstat (limited to 'source/libs/asura-lib-utils/threading/binding/_thread.cpp')
-rw-r--r-- | source/libs/asura-lib-utils/threading/binding/_thread.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/libs/asura-lib-utils/threading/binding/_thread.cpp b/source/libs/asura-lib-utils/threading/binding/_thread.cpp index 00252a9..9403486 100644 --- a/source/libs/asura-lib-utils/threading/binding/_thread.cpp +++ b/source/libs/asura-lib-utils/threading/binding/_thread.cpp @@ -18,7 +18,8 @@ namespace AsuraEngine { "AddTask", _AddTask }, { "IsRunning", _IsRunning }, { "IsCurrent", _IsCurrent }, - { "GetName", _GetName } + { "GetName", _GetName }, + { "Sleep", _Sleep } ); } @@ -81,7 +82,7 @@ namespace AsuraEngine LUAX_PREPARE(L, Thread); state.Push(self->IsRunning()); - return 0; + return 1; } // thread:IsCurrent() @@ -90,7 +91,7 @@ namespace AsuraEngine LUAX_PREPARE(L, Thread); state.Push(self->IsCurrent()); - return 0; + return 1; } // thread:GetName() @@ -98,6 +99,20 @@ namespace AsuraEngine { LUAX_PREPARE(L, Thread); + state.Push(self->GetName()); + return 1; + } + + // Thread.Sleep(milliseconds) + LUAX_IMPL_METHOD(Thread, _Sleep) + { + LUAX_STATE(L); + int ms = state.CheckValue<int>(1); +#if ASURA_THREAD_WIN32 + ::Sleep(ms); +#elif ASURA_THREAD_STD + +#endif return 0; } |