This release focuses on developer experience and cross-platform reliability. There are no public API changes — existing code continues to compile and run unchanged.
- GitHub Actions CI (
.github/workflows/ci.yml) — every push and pull request now builds the package, runs the full FPCUnit test suite, and builds all examples on both Linux and Windows. - Live CI badge — the README's hardcoded test-count badge has been replaced
with a real build-status badge, so the README always reflects the current
state of the
mainbranch.
CONTRIBUTING.md— build and test instructions, code style guide (including the unit-filename casing rule), and the pull-request workflow.- Issue templates (
.github/ISSUE_TEMPLATE/) — structured forms for bug reports and feature requests, plus a link to Discussions for questions. - Pull request template (
.github/PULL_REQUEST_TEMPLATE.md) — a checklist covering tests, changelog, docs, and the unit-casing convention. - README: Contributing section linking to
CONTRIBUTING.md.
Unit filenames now match their unit identifier casing exactly, so the library
compiles on case-sensitive filesystems such as Linux. On Windows this was
masked by the case-insensitive filesystem.
| Before | After |
|---|---|
src/threadpool.simple.pas |
src/ThreadPool.Simple.pas |
src/threadpool.producerconsumer.pas |
src/ThreadPool.ProducerConsumer.pas |
tests/threadpool.producerconsumer.tests.pas |
tests/ThreadPool.ProducerConsumer.Tests.pas |
The unit reference in tests/TestRunner.lpr was also normalized
(Threadpool. → ThreadPool.).
Setting up CI surfaced several issues that previously only affected Linux (and example builds) — all were masked on Windows:
- Access violation on Linux at runtime (exit code 217). The test runner and
example programs were missing the
cthreadsunit. On Unix/Linux, any program that creates threads must includecthreadsas its first unit; without it, constructing the thread pool crashed while setting up its worker threads and synchronization objects.{$IFDEF UNIX}cthreads{$ENDIF}was added to the test runner and all 8 examples. Windows does not need it and is unaffected. - Compilation on non-Windows targets.
TSimpleWorkerThreadhardcoded thestdcallcalling convention on itsIWorkerThreadmethods (QueryInterface/_AddRef/_Release). FPC'sIInterfaceonly usesstdcallon Windows andcdeclelsewhere, so the implementations didn't match on Linux. Now guarded with{$IFDEF WINDOWS}. - Hardened worker lifetime.
IWorkerThreadis now explicitly non-ref-counted (_AddRef/_Releasereturn-1), so an interface assignment can never free a worker the pool still owns viaClearThreads.TSimpleThreadPool.Destroyis also now safe to run on a partially constructed pool. - Example projects couldn't find the library. Every example except
Starterhad thesrcsearch path only in itsReleasebuild mode, solazbuild(which builds theDefaultmode) failed with "Can't find unit". The search path is now in each project's global compiler options. - Core-count-dependent tests. A few tests hardcoded thread-count expectations and queue-draining timing that only held on the developer's multi-core machine; on low-core CI runners the enforced 4-thread minimum made them fail. They now assert against the actual thread-count formula and overflow the queue with a burst sized off the real thread count, so they're deterministic on any number of cores.
- No code changes required.
uses ThreadPool.Simple;,uses ThreadPool.ProducerConsumer;, etc. are unchanged. - If you reference the source files by literal path (rare), update to the new capitalized filenames listed above.
CI builds the package, runs the test suite, and builds all 8 examples on both Linux and Windows:
- Test suite: 35 tests, 0 errors, 0 failures, 0 unfreed memory blocks.
- All 8 example projects build cleanly on both platforms.
See CHANGELOG.md for the complete version history.