Reuse threads in GainCal's parallel for
Created by: aroffringa
I noticed that GainCal is slower than it used to be. I'm not sure why, but a lot of threads are restarted during the parallel for structures. This commit keeps the threads running between iterations.
This required a barrier. Unfortunately, the barrier in boost is buggy and the barrier in std requires c++20 which we probably want to avoid, so I implemented a very simple one myself.