My initial suspicion would be the scoping of your mutex locks; try with them inside braces. You could also verify that in a debugger to see what the threads are doing.
↧