I can't really put the code here since i'm bounded by my company's policy.
Could you reduce your code to a minimal version that demonstrates the problem, is short enough to post, and contains no proprietary information?
For example, about a week ago, I also posted a question relating to threads. The initial problem I saw was in a big and secret perl script, that I would definitely not be allowed to post, but I reduced the script by removing & commenting out big blocks of code until I was left with a 25 line script that demonstrated the problem.
That script contains nothing secret so there is no problem posting it, and also it is much shorter so it is easy for our fellow monks to understand the problem.