载入中...
搜索中...
未找到
ThreadPool.h
浏览该文件的文档.
Thread-safe message queue (love2d-style Channel). Values are strings so the API stays overload-free f...
Definition Channel.h:17
A job executed by a ThreadPool worker. Status strings (no enums): "pending" | "running" | "done" | "f...
Definition Task.h:16
Fixed-size worker pool. Owns worker std::threads; tasks run FIFO. Squirrel VM is not thread-safe — do...
Definition ThreadPool.h:24
void waitAll()
Block until idle. Throws when called by a worker belonging to this pool.
Definition ThreadPool.cpp:156
ThreadPool(const ThreadPool &)=delete
ThreadPool & operator=(const ThreadPool &)=delete
Task * submitSleep(int ms)
Sleep on a worker, then mark done — useful from scripts / tests.
Definition ThreadPool.cpp:109
void stop()
Stop accepting work and join workers. Worker calls are rejected. Idempotent.
Definition ThreadPool.cpp:164
Task * submitPost(std::string name, std::string data="", int delayMs=0)
Sleep, then post an Event on the main queue (thread-safe). Scripts poll via event....
Definition ThreadPool.cpp:134
Task * submitPush(Channel *channel, std::string message, int delayMs=0)
Sleep, then push a message onto a channel (cross-thread signalling).
Definition ThreadPool.cpp:117
Task * submit(std::function< void()> fn)
Submit a C++ callable. Caller owns the Task wrapper; work owns its shared state.
Definition ThreadPool.cpp:91
@ Channel
Definition Build.cpp:11