I have a multithreaded application that runs using a custom thread pool class. The threads all execute the same function, with different parameters.
These parameters
All access to the job queue must be synchronized, i.e. performed only from 1 thread at a time by locking the job queue prior to access. Do you already have a critical section or some similar pattern to guard the shared resource? Synchronization issues often lead to weird behaviour and bugs which are hard to reproduce.