diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:57:47 +0100 |
commit | 3e16c3a78fff61c20e63ba730d15e94e3bb877b4 (patch) | |
tree | c070350db219f2c4241d22bc31949685c7b42fe9 /src/script/cpp_api/s_async.h | |
parent | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (diff) | |
parent | 6ccb5835ff55d85156be91473c598eca9d6cb9a6 (diff) | |
download | dragonfireclient-3e16c3a78fff61c20e63ba730d15e94e3bb877b4.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/script/cpp_api/s_async.h')
-rw-r--r-- | src/script/cpp_api/s_async.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/script/cpp_api/s_async.h b/src/script/cpp_api/s_async.h index 1dc4145ba..b1f4bf45f 100644 --- a/src/script/cpp_api/s_async.h +++ b/src/script/cpp_api/s_async.h @@ -31,6 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc., // Forward declarations class AsyncEngine; + // Declarations // Data required to queue a job @@ -51,10 +52,9 @@ struct LuaJobInfo }; // Asynchronous working environment -class AsyncWorkerThread : public Thread, public ScriptApiBase -{ +class AsyncWorkerThread : public Thread, public ScriptApiBase { public: - AsyncWorkerThread(AsyncEngine *jobDispatcher, const std::string &name); + AsyncWorkerThread(AsyncEngine* jobDispatcher, const std::string &name); virtual ~AsyncWorkerThread(); void *run(); @@ -64,11 +64,9 @@ private: }; // Asynchornous thread and job management -class AsyncEngine -{ +class AsyncEngine { friend class AsyncWorkerThread; typedef void (*StateInitializer)(lua_State *L, int top); - public: AsyncEngine() = default; ~AsyncEngine(); @@ -127,7 +125,7 @@ protected: * @param L Lua stack to initialize * @param top Stack position */ - void prepareEnvironment(lua_State *L, int top); + void prepareEnvironment(lua_State* L, int top); private: // Variable locking the engine against further modification @@ -151,7 +149,7 @@ private: std::deque<LuaJobInfo> resultQueue; // List of current worker threads - std::vector<AsyncWorkerThread *> workerThreads; + std::vector<AsyncWorkerThread*> workerThreads; // Counter semaphore for job dispatching Semaphore jobQueueCounter; |