Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
You did not mention which version of ImageMagick you are using. ImageMagick 6.2.6 has a patch to the thread locking code that might fix the problem you are having. If you are running ImageMagick 6.2.6, let us know and we will investigate further. It would be helpful to have a small code snippet we could use to reproduce the problem.
The ImageMagick developers have applied your suggestions against the current development branch. They will be available in ImageMagick 6.2.6-2 when its released in a few weeks. Thanks for the problem report and suggested fixes.
You of course are right. The patch we applied as you suggested was incomplete. We will have an additional patch in ImageMagick 6.2.8-5 Beta by tommorrow to fix the problem. Thanks for the problem report.