Commit graph

1 commit

Author SHA1 Message Date
Andreas Kling
8d234620bc LibThreading: Add ThreadPool class
Add a simple thread pool with a fixed number of worker threads and a
shared work queue. The pool is accessed via ThreadPool::the() which
lazily creates a singleton with 4 worker threads.

submit() enqueues a work item and signals a condvar. Worker threads
loop waiting on the condvar, picking up and executing work items.

Worker threads use 8 MiB stacks to match the main thread, since
the JS parser can build deep call stacks during off-thread parsing.
2026-03-06 13:06:05 +01:00