Avoid memory leaks
This commit replaces the threadpool crate with a handcrafted solution based on scoped threads. This leaves valgrind much happier than before. We also lose some dependency baggage.
Closes #45
@hanna-kruppe, many thanks you for your review. Appreciate you took the time to look in-depth. I've refactored my approach a couple of times before my initial commit. Actually I've been there before, at roughly what you proposed above. Anyway, I hope the update resonates better with you and an authority.
Due to me not being able to push to your branch, I had to merge manually, which (paired with a rebase), github does not recognize. But here, your changes are merged: https://github.com/LukasKalbertodt/libtest-mimic/commit/d194ff99f600e9adecd1ffb262e764b9ab8e03d2
Thank you @hanna-kruppe for already reviewing this before. Out of curiosity: what made you look into removing the dependency?
Every once in a while I like the exercise of reading through the lockfile. I was surprised to see num_cpus in one of my lockfiles, since it's a relic of the bad old days before std::thread::available_parallelism. After tracing that back to threadpool and looking at its lack of activity, open issues, and skimming the implementation, I thought there's gotta be a simpler way to run some tests in parallel.
@hanna-kruppe Ah, that makes. I also do regularly do that (mostly via cargo tree). I'm simply not personally using libtest-mimic, so I tend to not notice this stuff.
And by the way (for the two of you): I just released v0.8.0 with these changes.