diff --git a/.travis.yml b/.travis.yml index 5625450..9868d35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp dist: trusty -osx_image: xcode8.3 +osx_image: xcode10 sudo: required env: diff --git a/src/cpp/threading.cpp b/src/cpp/threading.cpp index 1d292a3..d3fddfc 100644 --- a/src/cpp/threading.cpp +++ b/src/cpp/threading.cpp @@ -10,15 +10,15 @@ namespace effil { -using Status = ThreaHandle::Status; -using Command = ThreaHandle::Command; +using Status = ThreadHandle::Status; +using Command = ThreadHandle::Command; namespace { const sol::optional NO_TIMEOUT; // Thread specific pointer to current thread -static thread_local ThreaHandle* thisThreadHandle = nullptr; +static thread_local ThreadHandle* thisThreadHandle = nullptr; // Doesn't inherit std::exception // to prevent from catching this exception third party lua C++ libs @@ -86,14 +86,14 @@ void luaHook(lua_State*, lua_Debug*) { } // namespace -ThreaHandle::ThreaHandle() +ThreadHandle::ThreadHandle() : status_(Status::Running) , command_(Command::Run) , lua_(std::make_unique(luaErrorHandlerPtr)) { luaL_openlibs(*lua_); } -void ThreaHandle::putCommand(Command cmd) { +void ThreadHandle::putCommand(Command cmd) { std::unique_lock lock(stateLock_); if (isFinishStatus(status_)) return; @@ -103,7 +103,7 @@ void ThreaHandle::putCommand(Command cmd) { commandNotifier_.notify(); } -void ThreaHandle::changeStatus(Status stat) { +void ThreadHandle::changeStatus(Status stat) { std::unique_lock lock(stateLock_); status_ = stat; commandNotifier_.reset(); diff --git a/src/cpp/threading.h b/src/cpp/threading.h index b1fee59..6f3df81 100644 --- a/src/cpp/threading.h +++ b/src/cpp/threading.h @@ -13,7 +13,7 @@ std::string threadId(); void yield(); void sleep(const sol::stack_object& duration, const sol::stack_object& metric); -class ThreaHandle : public GCData { +class ThreadHandle : public GCData { public: enum class Status { Running, @@ -30,7 +30,7 @@ public: }; public: - ThreaHandle(); + ThreadHandle(); Command command() const { return command_; } void putCommand(Command cmd); void changeStatus(Status stat); @@ -87,7 +87,7 @@ private: std::unique_ptr lua_; }; -class Thread : public GCObject { +class Thread : public GCObject { public: static void exportAPI(sol::state_view& lua);