The IndexWriter is supposed to be thread-safe, which means one IndexWriter class can be invoked by multiple threads to write index. But I find that it will deadlock in current implementation.
I have created a unit test file to write bogus strings to file and the deadlock can be repeated easily. The .cpp test is attached, you will need visual studio 2010 (or 2011) + boost 1.53 to run the example.
I have also investigated the issue and provided my local fix for the deadlock. The fix I believe will work, the modified files are also attached, you can compare to see the changes.
I would like to contribute to the CLucene development as a CLucene core developer, but I am not sure how to proceed.
Sorry for not creating my test cross-platform. I will try to improve gradually.